Beispiel #1
0
        public void Build_ConfigureViewModelProvidersIn_ShouldMapAllViewModelFactories()
        {
            var types = new DIConfiguration()
                        .ConfigureViewModelProvidersIn(this.GetType().Assembly)
                        .Build();

            var interfaceType      = typeof(IViewModelFactory <DummyViewModel, DummyViewModelProviderArgument>);
            var implementationType = typeof(ViewModelFactory <DummyViewModel, DummyViewModelProviderArgument>);

            Assert.IsTrue(types.ContainsKey(interfaceType));
            Assert.AreEqual(implementationType, types[interfaceType]);
        }
Beispiel #2
0
        public void Build_ConfigureViewModelProvidersIn_ShouldMapAllViewModelProviders()
        {
            new DIConfiguration()
            .SetImplementationType(x => x.CommandBus <DummyCommandBus>());

            var types = new DIConfiguration()
                        .ConfigureViewModelProvidersIn(this.GetType().Assembly)
                        .Build();

            var viewModelProviderInterfaceType      = typeof(IViewModelProvider <DummyViewModel, DummyViewModelProviderArgument>);
            var viewModelProviderImplementationType = typeof(DummyViewModelProvider);

            Assert.IsTrue(types.ContainsKey(viewModelProviderInterfaceType));
            Assert.AreEqual(viewModelProviderImplementationType, types[viewModelProviderInterfaceType]);
        }