Ejemplo n.º 1
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);
        }
Ejemplo n.º 2
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);
        }
Ejemplo n.º 3
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);
        }
Ejemplo n.º 4
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!");
        }