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); }
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"); } ); }