public void LoadViewModel_OnSelectClickekWrongFolder_SetsBlocked() { FolderManager manager = Substitute.For <FolderManager>(); DataProvider dataProvider = Substitute.For <DataProvider>(); Checker folderChecker = Substitute.For <Checker>(); FileIO fileIO = Substitute.For <FileIO>(); LoadViewModel viewModel = new LoadViewModel(dataProvider, folderChecker, manager, fileIO, Factories.GetMainWindowViewModelStub()); folderChecker.ReturnTrue = false; viewModel.SelectClickCommand.Execute(this); Assert.AreEqual(@"..\Icons\001-error.png", viewModel.CheckImage); }
public void LoadViewModel_OnSelectClickekCorrectFolder_SetsCheckmark() { //Arrange FolderManager manager = Substitute.For <FolderManager>(); DataProvider dataProvider = Substitute.For <DataProvider>(); Checker folderChecker = Substitute.For <Checker>(); FileIO fileIO = Substitute.For <FileIO>(); LoadViewModel viewModel = new LoadViewModel(dataProvider, folderChecker, manager, fileIO, Factories.GetMainWindowViewModelStub()); //Act viewModel.SelectClickCommand.Execute(this); //Assert Assert.AreEqual(@"..\Icons\002-success.png", viewModel.CheckImage); }
public void LoadViewModel_OnSelectClicked_CallsFolderChecker() { //Arrange FolderManager manager = Substitute.For <FolderManager>(); DataProvider dataProvider = Substitute.For <DataProvider>(); Checker folderChecker = Substitute.For <Checker>(); FileIO fileIO = Substitute.For <FileIO>(); LoadViewModel viewModel = new LoadViewModel(dataProvider, folderChecker, manager, fileIO, Factories.GetMainWindowViewModelStub()); //Act viewModel.SelectClickCommand.Execute(this); //Assert folderChecker.Received().IsCorrectFolder("return"); }
public void LoadViewModel_OnSelectClicked_ReceivesStringOfSelectedFile() { //Arrange FolderManager manager = Substitute.For <FolderManager>(); DataProvider dataProvider = Substitute.For <DataProvider>(); FolderChecker folderChecker = Substitute.For <FolderChecker>(); FileIO fileIO = Substitute.For <FileIO>(); LoadViewModel viewModel = new LoadViewModel(dataProvider, folderChecker, manager, fileIO, Factories.GetMainWindowViewModelStub()); //Act viewModel.SelectClickCommand.Execute(this); //Assert Assert.AreEqual("return", manager.LastSelected); }
public void LoadViewModel_OnSelectClickedError_ReceivesSelectorError() { //Arrange FolderManager manager = Substitute.For <FolderManager>(); DataProvider dataProvider = Substitute.For <DataProvider>(); FolderChecker folderChecker = Substitute.For <FolderChecker>(); FileIO fileIO = Substitute.For <FileIO>(); LoadViewModel viewModel = new LoadViewModel(dataProvider, folderChecker, manager, fileIO, Factories.GetMainWindowViewModelStub()); //Act viewModel.SelectClickCommand.Execute(this); manager.ThrowError = true; viewModel.SelectClickCommand.Execute(this); //Assert Assert.AreEqual("", viewModel.PathText); }
public FolderManager GetFolderManager() { FolderManager manager = new FolderManager(); return(manager); }