Exemplo n.º 1
0
        public void FileFontConfiguration_DefaultInitialisation_PropertyFontWeightIsInitilised()
        {
            FakeExplorerTreeViewModel stubExplorerTreeVM    = CreateFakeExplorerTreeVM();
            FileFontConfiguration     fileFontConfiguration = new FileFontConfiguration(stubExplorerTreeVM);

            Assert.AreEqual(FontWeights.Normal, fileFontConfiguration.FontWeight);
        }
Exemplo n.º 2
0
        public void FileFontConfiguration_DefaultInitialisation_PropertyFontFamilyIsInstantiated()
        {
            FakeExplorerTreeViewModel stubExplorerTreeVM    = CreateFakeExplorerTreeVM();
            FileFontConfiguration     fileFontConfiguration = new FileFontConfiguration(stubExplorerTreeVM);

            Assert.AreEqual(new System.Windows.Media.FontFamily("Times New Roman"), fileFontConfiguration.FontFamily);
        }
Exemplo n.º 3
0
        public void FileFontConfiguration_DefaultInitialisation_PropertyExplorerTreeVMIsInstantiated()
        {
            FakeExplorerTreeViewModel mockExplorerTreeVM    = CreateFakeExplorerTreeVM();
            FileFontConfiguration     fileFontConfiguration = new FileFontConfiguration(mockExplorerTreeVM);

            Assert.AreEqual(mockExplorerTreeVM, fileFontConfiguration.ExplorerTreeVM);
        }
Exemplo n.º 4
0
        public void FontWeight_SetGet_ReturnsSetValue()
        {
            FakeExplorerTreeViewModel stubExplorerTreeVM    = CreateFakeExplorerTreeVM();
            FileFontConfiguration     fileFontConfiguration = new FileFontConfiguration(stubExplorerTreeVM);

            fileFontConfiguration.FontWeight = FontWeights.Black;

            Assert.AreEqual(FontWeights.Black, fileFontConfiguration.FontWeight);
        }
Exemplo n.º 5
0
        public void FontStyle_SetGet_ReturnsSetValue()
        {
            FakeExplorerTreeViewModel stubExplorerTreeVM    = CreateFakeExplorerTreeVM();
            FileFontConfiguration     fileFontConfiguration = new FileFontConfiguration(stubExplorerTreeVM);

            fileFontConfiguration.FontStyle = FontStyles.Oblique;

            Assert.AreEqual(FontStyles.Oblique, fileFontConfiguration.FontStyle);
        }
Exemplo n.º 6
0
        public void FontStretch_SetGet_ReturnsSetValue()
        {
            FakeExplorerTreeViewModel stubExplorerTreeVM    = CreateFakeExplorerTreeVM();
            FileFontConfiguration     fileFontConfiguration = new FileFontConfiguration(stubExplorerTreeVM);

            fileFontConfiguration.FontStretch = FontStretches.Expanded;

            Assert.AreEqual(FontStretches.Expanded, fileFontConfiguration.FontStretch);
        }
Exemplo n.º 7
0
        public void FontSize_SetGet_ReturnsSetValue()
        {
            FakeExplorerTreeViewModel stubExplorerTreeVM    = CreateFakeExplorerTreeVM();
            FileFontConfiguration     fileFontConfiguration = new FileFontConfiguration(stubExplorerTreeVM);

            fileFontConfiguration.FontSize = 500;

            Assert.AreEqual(500, fileFontConfiguration.FontSize);
        }
Exemplo n.º 8
0
        public void FontFamily_SetGet_ReturnsSetValue()
        {
            FakeExplorerTreeViewModel stubExplorerTreeVM    = CreateFakeExplorerTreeVM();
            FileFontConfiguration     fileFontConfiguration = new FileFontConfiguration(stubExplorerTreeVM);

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

            Assert.AreEqual(new System.Windows.Media.FontFamily("Arial"), fileFontConfiguration.FontFamily);
        }
Exemplo n.º 9
0
        public void FontWeight_ForeachDriveUpdateChilds_FontVMUpdateWasCalled()
        {
            FileFontConfiguration fileFontConfiguration = CreateFileFontConfigurationOnlyDriveWithFile();

            fileFontConfiguration.FontWeight = FontWeights.Black;

            foreach (var mockDrive in fileFontConfiguration.ExplorerTreeVM.Drives)
            {
                Assert.AreEqual(true, (mockDrive.ChildTreeItemVMs.First().FontVM as FakeFontViewModel).UpdateWasCalled);
            }
        }
Exemplo n.º 10
0
        public void FontWeight_SetSameValueAgain_FontVMUpdateWasNotCalled()
        {
            FileFontConfiguration fileFontConfiguration = CreateFileFontConfigurationOnlyDriveWithFile();

            fileFontConfiguration.FontWeight = fileFontConfiguration.FontWeight;

            foreach (var mockDrive in fileFontConfiguration.ExplorerTreeVM.Drives)
            {
                Assert.AreEqual(false, (mockDrive.ChildTreeItemVMs.First().FontVM as FakeFontViewModel).UpdateWasCalled);
            }
        }
Exemplo n.º 11
0
        public void FontFamily_ForeachDriveUpdateChilds_FontVMUpdateWasCalled()
        {
            FileFontConfiguration fileFontConfiguration = CreateFileFontConfigurationOnlyDriveWithFile();

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

            foreach (var mockDrive in fileFontConfiguration.ExplorerTreeVM.Drives)
            {
                Assert.AreEqual(true, (mockDrive.ChildTreeItemVMs.First().FontVM as FakeFontViewModel).UpdateWasCalled);
            }
        }
Exemplo n.º 12
0
        public void ForeachDriveUpdateChilds_UpdateAllFiles_FontVmUpdateWasCalled()
        {
            FakeExplorerTreeViewModel stubExplorerTreeVM    = CreateFakeExplorerTreeVM();
            FileFontConfiguration     fileFontConfiguration = new FileFontConfiguration(stubExplorerTreeVM);

            fileFontConfiguration.ForeachDriveUpdateChilds();

            var allFakeFiles = stubExplorerTreeVM.GetAllFakeFiles();

            foreach (var mockFile in allFakeFiles)
            {
                Assert.AreEqual(true, (mockFile.FontVM as FakeFontViewModel).UpdateWasCalled,
                                "The fakePath of the item whose " + nameof(mockFile.FontVM.Update) + "-Method was not called is: " +
                                mockFile.FullName);
            }
        }
Exemplo n.º 13
0
        public void ForeachDriveUpdateChilds_DrivePropertyNameIsDummyChild_FontVmUpdateWasNotCalled()
        {
            FakeExplorerTreeViewModel stubExplorerTreeVM = CreateFakeExplorerTreeVM();
            FakeDriveItemViewModel    mockDriveItemVM    = new FakeDriveItemViewModel();

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


            fileFontConfiguration.ForeachDriveUpdateChilds();


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