internal static ControlHandle TryGetUploadWindow(string browserName) { var processName = GetBrowserProcessName(browserName); var browserWindow = WindowLocator.GetWindows(processName); return(browserWindow.SelectMany(w => w.GetChildrenWindows()).FirstOrDefault()); }
public void CreateWindowReturnsCorrectResult(WindowLocator sut, FakeViewModel viewModel) { sut.Register <FakeViewModel, FakeWindow>(); var actual = sut.CreateWindow(viewModel, null); Assert.IsType <FakeWindow>(actual); }
public void GetDistinctTypes_WhenFilterText_IsNull(WindowLocator sut) { var fixture = new Fixture(); var types = fixture.CreateMany <Type>(1); Assert.Throws <ArgumentNullException>(() => sut.GetDistinctTypes(types, new EndsWithTypeFilter(null))); }
public void GetDistinctTypes_WhenTypesAreEmpty_ReturnEmpty(WindowLocator sut) { var types = new List <Type>(); var actual = sut.GetDistinctTypes(types).ToList(); Assert.Equal(0, actual.Count); }
public void GetDistinctTypes_WhenResult_NotEmpty(WindowLocator sut) { var fixture = new Fixture(); var types = fixture.CreateMany <Type>(5); var actual = sut.GetDistinctTypes(types).ToList(); Assert.Equal(1, actual.Count); }
private void Application_Startup(object sender, StartupEventArgs e) { using (var diContainer = new DIContainer()) { diContainer.Configure(); diContainer.ConfigureWindows(); var wl = new WindowLocator(diContainer); wl.OpenWindow <Window_Main>(); } }
public void NullViewModelThrowsException(WindowLocator sut, FakeViewModel owner) { Assert.Throws <ArgumentNullException>(() => sut.CreateWindow(null, owner)); }
public void FindNamespaceInAssembly_ReturnsCorrectResult(string target, string expected, WindowLocator sut, TestAssembly assembly) { var actual = sut.FindNamespaceInAssembly(assembly, target); Assert.Equal(expected, actual); }
public void FindNamespaceInAssembly_WhenName_IsNull(WindowLocator sut, Assembly assembly) { Assert.Throws <ArgumentNullException>(() => sut.FindNamespaceInAssembly(assembly, null)); }
public void FindNamespaceInAssembly_WhenAssembly_IsNull(WindowLocator sut, string name) { Assert.Throws <ArgumentNullException>(() => sut.FindNamespaceInAssembly(null, name)); }
public void VerifyValidBaseType_ReturnsCorrectResult(Type currentType, bool expected, WindowLocator sut) { var validTypes = new List <Type> { typeof(Window), typeof(UserControl) }; var actual = sut.VerifyValidBaseType(currentType, validTypes); Assert.Equal(expected, actual); }
public void VerifyValidBaseType_WhenValidTypes_IsNull(WindowLocator sut, Type type) { Assert.Throws <ArgumentNullException>(() => sut.VerifyValidBaseType(type, null)); }
public void VerifyValidBaseType_WhenCurrentType_IsNull(WindowLocator sut, IEnumerable <Type> validTypes) { Assert.Throws <ArgumentNullException>(() => sut.VerifyValidBaseType(null, validTypes)); }
public void RegisterManuel_WhenModelType_IsNull(WindowLocator sut, Type viewModelType) { Assert.Throws <ArgumentNullException>(() => sut.Register(viewModelType, null)); }
public void Register_WhenViewModelType_IsNull(WindowLocator sut) { Assert.Throws <ArgumentNullException>(() => sut.Register(null)); }
public void GetBaseName_WhenViewModel_IsNull(WindowLocator sut) { Assert.Throws <ArgumentNullException>(() => sut.GetBaseName(null)); }
public void ViewModelTypeNotRegisteredReturnsNull(WindowLocator sut, FakeViewModel viewModel) { var actual = sut.CreateWindow(viewModel, null); Assert.Null(actual); }
public void ConvertNameToType_ReturnsCorrectResult(string typeName, Type expected, WindowLocator sut, Assembly assembly) { var actual = sut.ConvertNameToType(typeName, assembly); Assert.Equal(expected, actual); }
public void ConvertNameToType_WhenAssembly_IsNull(WindowLocator sut, string typeName) { Assert.Throws <ArgumentNullException>(() => sut.ConvertNameToType(typeName, null)); }
public void ConvertNameToType_WhenTypeName_IsNull(WindowLocator sut, Assembly assembly) { Assert.Throws <ArgumentNullException>(() => sut.ConvertNameToType(null, assembly)); }
public void GetBaseName_ReturnsCorrectResult(string viewModel, string expected, WindowLocator sut) { var actual = sut.GetBaseName(viewModel); Assert.Equal(expected, actual); }
public void InitializedReturnsCorrectResult(Assembly assembly, IWindowInitiator windowInitiator, IMetric metric) { var sut = new WindowLocator(assembly, windowInitiator, metric); Assert.NotNull(sut); }
public void GetDistinctTypes_WhenTypes_IsNull(WindowLocator sut) { Assert.Throws <ArgumentNullException>(() => sut.GetDistinctTypes(null)); }