Esempio n. 1
0
        public void DriveFontConfiguration_DefaultInitialisation_PropertyFontFamilyIsInstantiated()
        {
            FakeExplorerTreeViewModel stubExplorerTreeVM     = CreateFakeExplorerTreeVM();
            DriveFontConfiguration    driveFontConfiguration = new DriveFontConfiguration(stubExplorerTreeVM);

            Assert.AreEqual(new System.Windows.Media.FontFamily("Times New Roman"), driveFontConfiguration.FontFamily);
        }
Esempio n. 2
0
        public void DriveFontConfiguration_DefaultInitialisation_PropertyFontWeightIsInitilised()
        {
            FakeExplorerTreeViewModel stubExplorerTreeVM     = CreateFakeExplorerTreeVM();
            DriveFontConfiguration    driveFontConfiguration = new DriveFontConfiguration(stubExplorerTreeVM);

            Assert.AreEqual(FontWeights.Normal, driveFontConfiguration.FontWeight);
        }
Esempio n. 3
0
        public void DriveFontConfiguration_DefaultInitialisation_PropertyExplorerTreeVMIsInstantiated()
        {
            FakeExplorerTreeViewModel mockExplorerTreeVM     = CreateFakeExplorerTreeVM();
            DriveFontConfiguration    driveFontConfiguration = new DriveFontConfiguration(mockExplorerTreeVM);

            Assert.AreEqual(mockExplorerTreeVM, driveFontConfiguration.ExplorerTreeVM);
        }
Esempio n. 4
0
        public void FontWeight_SetGet_ReturnsSetValue()
        {
            FakeExplorerTreeViewModel stubExplorerTreeVM     = CreateFakeExplorerTreeVM();
            DriveFontConfiguration    driveFontConfiguration = new DriveFontConfiguration(stubExplorerTreeVM);

            driveFontConfiguration.FontWeight = FontWeights.Black;

            Assert.AreEqual(FontWeights.Black, driveFontConfiguration.FontWeight);
        }
Esempio n. 5
0
        public void FontStyle_SetGet_ReturnsSetValue()
        {
            FakeExplorerTreeViewModel stubExplorerTreeVM     = CreateFakeExplorerTreeVM();
            DriveFontConfiguration    driveFontConfiguration = new DriveFontConfiguration(stubExplorerTreeVM);

            driveFontConfiguration.FontStyle = FontStyles.Oblique;

            Assert.AreEqual(FontStyles.Oblique, driveFontConfiguration.FontStyle);
        }
Esempio n. 6
0
        public void FontStretch_SetGet_ReturnsSetValue()
        {
            FakeExplorerTreeViewModel stubExplorerTreeVM     = CreateFakeExplorerTreeVM();
            DriveFontConfiguration    driveFontConfiguration = new DriveFontConfiguration(stubExplorerTreeVM);

            driveFontConfiguration.FontStretch = FontStretches.Expanded;

            Assert.AreEqual(FontStretches.Expanded, driveFontConfiguration.FontStretch);
        }
Esempio n. 7
0
        public void FontSize_SetGet_ReturnsSetValue()
        {
            FakeExplorerTreeViewModel stubExplorerTreeVM     = CreateFakeExplorerTreeVM();
            DriveFontConfiguration    driveFontConfiguration = new DriveFontConfiguration(stubExplorerTreeVM);

            driveFontConfiguration.FontSize = 500;

            Assert.AreEqual(500, driveFontConfiguration.FontSize);
        }
Esempio n. 8
0
        public void FontFamily_SetGet_ReturnsSetValue()
        {
            FakeExplorerTreeViewModel stubExplorerTreeVM     = CreateFakeExplorerTreeVM();
            DriveFontConfiguration    driveFontConfiguration = new DriveFontConfiguration(stubExplorerTreeVM);

            driveFontConfiguration.FontFamily = new System.Windows.Media.FontFamily("Arial");

            Assert.AreEqual(new System.Windows.Media.FontFamily("Arial"), driveFontConfiguration.FontFamily);
        }
Esempio n. 9
0
        public void FontWeight_ForeachDriveUpdateChilds_FontVMUpdateWasCalled()
        {
            DriveFontConfiguration driveFontConfiguration = CreateDriveFontConfigurationOnlyDriveWithFile();

            driveFontConfiguration.FontWeight = FontWeights.Black;

            foreach (var mockDrive in driveFontConfiguration.ExplorerTreeVM.Drives)
            {
                Assert.AreEqual(true, (mockDrive.FontVM as FakeFontViewModel).UpdateWasCalled);
            }
        }
Esempio n. 10
0
        public void FontWeight_SetSameValueAgain_FontVMUpdateWasNotCalled()
        {
            DriveFontConfiguration driveFontConfiguration = CreateDriveFontConfigurationOnlyDriveWithFile();

            driveFontConfiguration.FontWeight = driveFontConfiguration.FontWeight;

            foreach (var mockDrive in driveFontConfiguration.ExplorerTreeVM.Drives)
            {
                Assert.AreEqual(false, (mockDrive.FontVM as FakeFontViewModel).UpdateWasCalled);
            }
        }
Esempio n. 11
0
        public void FontFamily_ForeachDriveUpdateChilds_FontVMUpdateWasCalled()
        {
            DriveFontConfiguration driveFontConfiguration = CreateDriveFontConfigurationOnlyDriveWithFile();

            driveFontConfiguration.FontFamily = new System.Windows.Media.FontFamily("Arial");

            foreach (var mockDrive in driveFontConfiguration.ExplorerTreeVM.Drives)
            {
                Assert.AreEqual(true, (mockDrive.FontVM as FakeFontViewModel).UpdateWasCalled);
            }
        }
Esempio n. 12
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);
            }
        }
Esempio n. 13
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);
            }
        }