public void DirectoryIconConfiguration_DefaultInitialisation_PropertyExplorerTreeVMIsInitialised() { ExplorerTreeViewModel mockExplorerTreeVM = CreateFakeExplorerTreeVM(); DirectoryIconConfiguration directoryIconConfiguration = new DirectoryIconConfiguration(mockExplorerTreeVM); Assert.AreEqual(mockExplorerTreeVM, directoryIconConfiguration.ExplorerTreeVM); }
public void SetLargeIconToActiveIcon_SetPropertyActiveIconStateToLargeIcon_ReturnsSetValue() { DirectoryIconConfiguration directoryIconConfiguration = CreateDefaultDirectoryIconConfiguration(); directoryIconConfiguration.SetLargeIconToActiveIcon(); Assert.AreEqual(IconStates.LargeIcon, directoryIconConfiguration.ActiveIconState); }
public void SetLargeIconToActiveIcon_ForeachDriveUpdateChildsWithLargeIcon_ForeachDirectorySetLargeImageSourceToActiveImageSourceWasCalled() { DirectoryIconConfiguration directoryIconConfiguration = CreateDefaultDirectoryIconConfiguration(); directoryIconConfiguration.SetLargeIconToActiveIcon(); List <FakeDirectoryItemViewModel> fakeDirectoryItemVMs = (directoryIconConfiguration.ExplorerTreeVM as FakeExplorerTreeViewModel).GetAllFakeDirectories(); foreach (var mockDirectory in fakeDirectoryItemVMs) { Assert.AreEqual(true, (mockDirectory.IconVM as FakeIconViewModel).ActiveImageSourceWasSetToLargeImageSource, "The fakePath of the item whose " + nameof(mockDirectory.IconVM.SetLargeImageSourceToActiveImageSource) + "-Method was not called is: " + mockDirectory.FullName); } }
public void SetSmallIconToActiveIcon_FileInsteadOfDirectory_ForeachDirectorySetSmallImageSourceToActiveImageSourceWasNotCalled() { FakeExplorerTreeViewModel stubExplorerTreeVM = CreateFakeExplorerTreeVM(); FakeDriveItemViewModel mockDriveItemVM = new FakeDriveItemViewModel(); mockDriveItemVM.CreateAddAndGetFakeFile("FakeFile"); stubExplorerTreeVM.Drives.Clear(); // cleare because for this test we need special fakeExplorerTree. stubExplorerTreeVM.Drives.Add(mockDriveItemVM); DirectoryIconConfiguration directoryIconConfiguration = CreateDirectoryIconConfigurationWithVariableExplorerTreeVM(stubExplorerTreeVM); directoryIconConfiguration.SetSmallIconToActiveIcon(); foreach (var mockDrive in stubExplorerTreeVM.Drives) { Assert.AreEqual(false, (mockDrive.ChildTreeItemVMs.First().IconVM as FakeIconViewModel).ActiveImageSourceWasSetToSmallImageSource); } }
public void DirectoryIconConfiguration_DefaultInitialisation_PropertyActiveIconStateIsInitialised() { DirectoryIconConfiguration directoryIconConfiguration = new DirectoryIconConfiguration(CreateFakeExplorerTreeVM()); Assert.AreEqual(IconStates.SmallIcon, directoryIconConfiguration.ActiveIconState); }