Exemplo n.º 1
0
        public void UpdateDrives_UpdateForeachDrive_FontVmUpdateWasCalled()
        {
            FakeExplorerTreeViewModel stubExplorerTreeVM     = CreateFakeExplorerTreeVM();
            DriveFontConfiguration    driveFontConfiguration = new DriveFontConfiguration(stubExplorerTreeVM);

            driveFontConfiguration.UpdateDrives();

            foreach (var mockDrive in stubExplorerTreeVM.Drives)
            {
                Assert.AreEqual(true, (mockDrive.FontVM as FakeFontViewModel).UpdateWasCalled,
                                "The fakePath of the item whose " + nameof(mockDrive.FontVM.Update) + "-Method was not called is: " +
                                mockDrive.Name);
            }
        }
Exemplo n.º 2
0
        public void UpdateDrives_DrivePropertyNameIsDummyChild_FontVmUpdateWasNotCalled()
        {
            FakeExplorerTreeViewModel stubExplorerTreeVM = CreateFakeExplorerTreeVM();

            FakeDriveItemViewModel mockDriveItemVM = new FakeDriveItemViewModel();

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

            DriveFontConfiguration driveFontConfiguration = new DriveFontConfiguration(stubExplorerTreeVM);


            driveFontConfiguration.UpdateDrives();


            foreach (var mockDrive in stubExplorerTreeVM.Drives)
            {
                Assert.AreEqual(false, (mockDrive.FontVM as FakeFontViewModel).UpdateWasCalled);
            }
        }