Exemplo n.º 1
0
        public void DirectoryIconConfiguration_DefaultInitialisation_PropertyExplorerTreeVMIsInitialised()
        {
            ExplorerTreeViewModel      mockExplorerTreeVM         = CreateFakeExplorerTreeVM();
            DirectoryIconConfiguration directoryIconConfiguration = new DirectoryIconConfiguration(mockExplorerTreeVM);

            Assert.AreEqual(mockExplorerTreeVM, directoryIconConfiguration.ExplorerTreeVM);
        }
Exemplo n.º 2
0
        public void SetLargeIconToActiveIcon_SetPropertyActiveIconStateToLargeIcon_ReturnsSetValue()
        {
            DirectoryIconConfiguration directoryIconConfiguration = CreateDefaultDirectoryIconConfiguration();

            directoryIconConfiguration.SetLargeIconToActiveIcon();

            Assert.AreEqual(IconStates.LargeIcon, directoryIconConfiguration.ActiveIconState);
        }
Exemplo n.º 3
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);
            }
        }
Exemplo n.º 4
0
        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);
            }
        }
Exemplo n.º 5
0
        public void DirectoryIconConfiguration_DefaultInitialisation_PropertyActiveIconStateIsInitialised()
        {
            DirectoryIconConfiguration directoryIconConfiguration = new DirectoryIconConfiguration(CreateFakeExplorerTreeVM());

            Assert.AreEqual(IconStates.SmallIcon, directoryIconConfiguration.ActiveIconState);
        }