public void ReturnsCompatibleValues(Type viewType, bool expectedValue) { var viewLocator = new ViewLocator(); viewLocator.Register(typeof(MyNameViewerViewModel), typeof(MyNameViewer)); viewLocator.Register(typeof(MyNameViewerViewModel), typeof(MyNameViewer2)); var isCompatible = viewLocator.IsCompatible(typeof(MyNameViewerViewModel), viewType); Assert.AreEqual(expectedValue, isCompatible); }
public void ThrowsArgumentNullExceptionForNullResolvedType() { var viewLocator = new ViewLocator(); ExceptionTester.CallMethodAndExpectException <ArgumentNullException>(() => viewLocator.IsCompatible(typeof(NoNamingConventionViewModel), null)); }
public void ThrowsArgumentNullExceptionForNullTypeToResolve() { var viewLocator = new ViewLocator(); ExceptionTester.CallMethodAndExpectException <ArgumentNullException>(() => viewLocator.IsCompatible(null, typeof(FollowingNoNamingConventionView))); }