public void SetSmallIconToActiveIcon_SetPropertyActiveIconStateToSmallIcon_ReturnsSetValue() { DirectoryIconConfiguration directoryIconConfiguration = CreateDefaultDirectoryIconConfiguration(); directoryIconConfiguration.SetSmallIconToActiveIcon(); Assert.AreEqual(IconStates.SmallIcon, directoryIconConfiguration.ActiveIconState); }
public void SetSmallIconToActiveIcon_ForeachDriveUpdateChildsWithSmallIcon_ForeachDirectorySetSmallImageSourceToActiveImageSourceWasCalled() { DirectoryIconConfiguration directoryIconConfiguration = CreateDefaultDirectoryIconConfiguration(); directoryIconConfiguration.SetSmallIconToActiveIcon(); List <FakeDirectoryItemViewModel> fakeDirectoryItemVMs = (directoryIconConfiguration.ExplorerTreeVM as FakeExplorerTreeViewModel).GetAllFakeDirectories(); foreach (var mockDirectory in fakeDirectoryItemVMs) { Assert.AreEqual(true, (mockDirectory.IconVM as FakeIconViewModel).ActiveImageSourceWasSetToSmallImageSource, "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); } }