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));
        }
Ejemplo n.º 2
0
        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));
        }