public void LocateDialogTypeSuccessful(string viewModelFullName, string viewFullName) { // Arrange Type viewModelType = testAssembly.GetType(viewModelFullName); Assert.IsNotNull(viewModelType); var viewModel = (INotifyPropertyChanged)Activator.CreateInstance(viewModelType); // Act Type dialogType = dialogTypeLocator.Locate(viewModel); // Assert Assert.That(dialogType.FullName, Is.EqualTo(viewFullName)); }
public void LocateDialogTypeUnsuccessful(string viewModelFullName) { // Arrange var dialogTypeLocator = new NamingConventionDialogTypeLocator(); Type viewModelType = testAssembly.GetType(viewModelFullName); Assert.IsNotNull(viewModelType); var viewModel = (INotifyPropertyChanged)Activator.CreateInstance(viewModelType); // Assert Assert.Throws <TypeLoadException>(() => dialogTypeLocator.Locate(viewModel)); }