Exemple #1
0
        private ExplorerTree.API.ExplorerTree CreateExplorerTree()
        {
            IConfiguration               fakeConfiguration               = Substitute.For <IConfiguration>();
            IPresentationLogic           fakePresentationLogic           = Substitute.For <IPresentationLogic>();
            ISelectedExplorerTreeItemAPI fakeSelectedExplorerTreeItemAPI = Substitute.For <ISelectedExplorerTreeItemAPI>();
            FakeExplorerTreeViewModel    fakeExplorerTreeVM              = new FakeExplorerTreeViewModel(fakeConfiguration, fakePresentationLogic);

            return(new ExplorerTree.API.ExplorerTree(fakeConfiguration, fakeExplorerTreeVM, fakePresentationLogic, fakeSelectedExplorerTreeItemAPI));
        }
        public void IconOverallConfiguration_Initialisation_ExplorerTreeVmIsInitialised()
        {
            IConfiguration            configuration            = CreateConfiguration();
            FakeExplorerTreeViewModel fakeExplorerTreeVM       = CreateFakeExplorerTreeVM(configuration);
            IconOverallConfiguration  iconOverallConfiguration = CreateIconOverallConfiguration(configuration, fakeExplorerTreeVM);


            Assert.AreEqual(fakeExplorerTreeVM, iconOverallConfiguration.ExplorerTreeVM);
        }
Exemple #3
0
        public void ExplorerTree_DefaultInitialisation_ExplorerTreeMethodLoadAllDriveItemViewModelsWasCalled()
        {
            IConfiguration               fakeConfiguration               = Substitute.For <IConfiguration>();
            IPresentationLogic           fakePresentationLogic           = Substitute.For <IPresentationLogic>();
            ISelectedExplorerTreeItemAPI fakeSelectedExplorerTreeItemAPI = Substitute.For <ISelectedExplorerTreeItemAPI>();
            FakeExplorerTreeViewModel    fakeExplorerTreeVM              = new FakeExplorerTreeViewModel(fakeConfiguration, fakePresentationLogic);

            IExplorerTree explorerTree = new ExplorerTree.API.ExplorerTree(fakeConfiguration, fakeExplorerTreeVM, fakePresentationLogic, fakeSelectedExplorerTreeItemAPI);

            Assert.AreEqual(true, fakeExplorerTreeVM.LoadAllDriveItemViewModelsWasCalled);
        }
Exemple #4
0
        public void ExplorerTree_DefaultInitialisation_CofigurationMethodInitialisationWasCalledWithExplorerTreeVM()
        {
            IConfiguration               fakeConfiguration               = Substitute.For <IConfiguration>();
            IPresentationLogic           fakePresentationLogic           = Substitute.For <IPresentationLogic>();
            ISelectedExplorerTreeItemAPI fakeSelectedExplorerTreeItemAPI = Substitute.For <ISelectedExplorerTreeItemAPI>();
            FakeExplorerTreeViewModel    fakeExplorerTreeVM              = new FakeExplorerTreeViewModel(fakeConfiguration, fakePresentationLogic);

            IExplorerTree explorerTree = new ExplorerTree.API.ExplorerTree(fakeConfiguration, fakeExplorerTreeVM, fakePresentationLogic, fakeSelectedExplorerTreeItemAPI);

            fakeConfiguration.Received().Initialisation(fakeExplorerTreeVM);
        }
Exemple #5
0
        public void ExplorerTree_DefaultInitialisation_PresentationLogicPropertyExplorerTreeVMIsInitialised()
        {
            IConfiguration               fakeConfiguration               = Substitute.For <IConfiguration>();
            IPresentationLogic           fakePresentationLogic           = Substitute.For <IPresentationLogic>();
            ISelectedExplorerTreeItemAPI fakeSelectedExplorerTreeItemAPI = Substitute.For <ISelectedExplorerTreeItemAPI>();
            FakeExplorerTreeViewModel    fakeExplorerTreeVM              = new FakeExplorerTreeViewModel(fakeConfiguration, fakePresentationLogic);

            IExplorerTree explorerTree = new ExplorerTree.API.ExplorerTree(fakeConfiguration, fakeExplorerTreeVM, fakePresentationLogic, fakeSelectedExplorerTreeItemAPI);

            Assert.AreEqual(fakePresentationLogic.ExplorerTreeVM, (explorerTree as ExplorerTree.API.ExplorerTree).PresentationLogic.ExplorerTreeVM);
        }
        private static DirectoryFontConfiguration CreateDirectoryFontConfigurationOneDirectoryDepthExplorerTree()
        {
            FakeExplorerTreeViewModel stubExplorerTreeVM = CreateFakeExplorerTreeVM();

            FakeDriveItemViewModel mockDriveItemVM = new FakeDriveItemViewModel();

            mockDriveItemVM.CreateAddAndGetFakeDirectory("FakeDirectory");
            stubExplorerTreeVM.Drives.Clear(); // cleare because for this tests we need special fakeExplorerTree.
            stubExplorerTreeVM.Drives.Add(mockDriveItemVM);

            return(new DirectoryFontConfiguration(stubExplorerTreeVM));
        }
Exemple #7
0
        public void ExplorerTree_DefaultInitialisation_AllPropertiesAreInitialised()
        {
            IConfiguration               fakeConfiguration               = Substitute.For <IConfiguration>();
            IPresentationLogic           fakePresentationLogic           = Substitute.For <IPresentationLogic>();
            ISelectedExplorerTreeItemAPI fakeSelectedExplorerTreeItemAPI = Substitute.For <ISelectedExplorerTreeItemAPI>();
            FakeExplorerTreeViewModel    fakeExplorerTreeVM              = new FakeExplorerTreeViewModel(fakeConfiguration, fakePresentationLogic);

            IExplorerTree explorerTree = new ExplorerTree.API.ExplorerTree(fakeConfiguration, fakeExplorerTreeVM, fakePresentationLogic, fakeSelectedExplorerTreeItemAPI);

            Assert.AreEqual(fakeConfiguration, explorerTree.Configuration, "Property: \"" + nameof(explorerTree.Configuration) + "\" was Not initialised correctly!");
            Assert.AreEqual(fakePresentationLogic, (explorerTree as ExplorerTree.API.ExplorerTree).PresentationLogic, "Property: \"" + "PresentationLogic" + "\" was Not initialised correctly!");
            Assert.AreEqual(fakeSelectedExplorerTreeItemAPI, explorerTree.SelectedItemAPI, "Property: \"" + nameof(explorerTree.SelectedItemAPI) + "\" was Not initialised correctly!");
            Assert.AreEqual(fakeExplorerTreeVM, explorerTree.ExplorerTreeVM, "Property: \"" + nameof(explorerTree.ExplorerTreeVM) + "\" was Not initialised correctly!");
        }
        public void SetSmallIconToActiveIcon_FilePropertyNameIsDummyChild_ForeachDirectorySetSmallImageSourceToActiveImageSourceWasNotCalled()
        {
            FakeExplorerTreeViewModel stubExplorerTreeVM = CreateFakeExplorerTreeVM();
            FakeDriveItemViewModel    mockDriveItemVM    = new FakeDriveItemViewModel();

            mockDriveItemVM.CreateAddAndGetFakeFile("FakeFile").Name = "DummyChild";
            stubExplorerTreeVM.Drives.Clear(); // cleare because for this test we need special fakeExplorerTree.
            stubExplorerTreeVM.Drives.Add(mockDriveItemVM);
            FileIconConfiguration fileIconConfiguration = CreateFileIconConfigurationWithVariableExplorerTreeVM(stubExplorerTreeVM);


            fileIconConfiguration.SetSmallIconToActiveIcon();


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