Beispiel #1
0
        public void SetLargeIconToActiveIcon_SetPropertyActiveIconStateToLargeIcon_ReturnsSetValue()
        {
            DirectoryIconConfiguration directoryIconConfiguration = CreateDefaultDirectoryIconConfiguration();

            directoryIconConfiguration.SetLargeIconToActiveIcon();

            Assert.AreEqual(IconStates.LargeIcon, directoryIconConfiguration.ActiveIconState);
        }
Beispiel #2
0
        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);
            }
        }
Beispiel #3
0
        public void SetLargeIconToActiveIcon_FileInsteadOfDirectory_ForeachDirectorySetLargeImageSourceToActiveImageSourceWasNotCalled()
        {
            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.SetLargeIconToActiveIcon();



            foreach (var mockDrive in stubExplorerTreeVM.Drives)
            {
                Assert.AreEqual(false, (mockDrive.ChildTreeItemVMs.First().IconVM as FakeIconViewModel).ActiveImageSourceWasSetToLargeImageSource);
            }
        }