Beispiel #1
0
        public void WhenViewRequested_ThenReturnsFromContainer()
        {
            var catalog = new TypeCatalog(typeof(TestView));
            var container = new CompositionContainer(catalog);

            var viewFactory = new ViewFactory(container);

            var view = viewFactory.GetView("TestView");
            Assert.IsNotNull(view);
        }
Beispiel #2
0
        public void WhenNonExistingVeiwRequested_ThenThrowsException()
        {
            var catalog = new TypeCatalog(typeof(TestView));
            var container = new CompositionContainer(catalog);

            var viewFactory = new ViewFactory(container);

            ExceptionAssert.Throws<Exception>(
                () =>
                {
                    viewFactory.GetView("NonExistentView");
                }
            );
        }