mardi 24 novembre 2015

Should I be unit testing my bootstrapper and if so how?

My bootstrapper inherits from UnityBootstrapper and I was attempting to unit test it and failed. I wanted to test that the correct modules get added in the ConfigureModuleCatalog method. Should I be trying to unit test this and if so how could I test it? I'm using .NET 4.5.1 and Prism 6

public class Bootstrapper : UnityBootstrapper
{
    protected override DependencyObject CreateShell()
    {
        return Container.Resolve<MainWindow>();
    }

    protected override void InitializeShell()
    {
        base.InitializeShell();
        Application.Current.MainWindow = (Window)Shell;
        Application.Current.MainWindow.Show();
    }

    protected override void ConfigureModuleCatalog()
    {
        ModuleCatalog moduleCatalog = (ModuleCatalog)ModuleCatalog;
        moduleCatalog.AddModule(typeof(MainShellModule));
    }
}

Aucun commentaire:

Enregistrer un commentaire