public void OverwritesExistingViewType() { var viewLocator = new ViewLocator(); viewLocator.Register(typeof(FollowingNoNamingConventionView), typeof(NoNamingConventionViewModel)); viewLocator.Register(typeof(FollowingNoNamingConventionView), typeof(NoNamingConventionViewModel2)); var resolvedView = viewLocator.ResolveView(typeof(FollowingNoNamingConventionView)); Assert.AreEqual(typeof(NoNamingConventionViewModel2), resolvedView); }
public void ThrowsArgumentNullExceptionForNullResolvedType() { var viewLocator = new ViewLocator(); ExceptionTester.CallMethodAndExpectException<ArgumentNullException>(() => viewLocator.Register(typeof(NoNamingConventionViewModel), null)); }
public void ThrowsArgumentNullExceptionForNullTypeToResolve() { var viewLocator = new ViewLocator(); ExceptionTester.CallMethodAndExpectException<ArgumentNullException>(() => viewLocator.Register(null, typeof(FollowingNoNamingConventionView))); }