public void FileFontConfiguration_DefaultInitialisation_PropertyFontWeightIsInitilised() { FakeExplorerTreeViewModel stubExplorerTreeVM = CreateFakeExplorerTreeVM(); FileFontConfiguration fileFontConfiguration = new FileFontConfiguration(stubExplorerTreeVM); Assert.AreEqual(FontWeights.Normal, fileFontConfiguration.FontWeight); }
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); }
public void FileFontConfiguration_DefaultInitialisation_PropertyExplorerTreeVMIsInstantiated() { FakeExplorerTreeViewModel mockExplorerTreeVM = CreateFakeExplorerTreeVM(); FileFontConfiguration fileFontConfiguration = new FileFontConfiguration(mockExplorerTreeVM); Assert.AreEqual(mockExplorerTreeVM, fileFontConfiguration.ExplorerTreeVM); }
public void FontWeight_SetGet_ReturnsSetValue() { FakeExplorerTreeViewModel stubExplorerTreeVM = CreateFakeExplorerTreeVM(); FileFontConfiguration fileFontConfiguration = new FileFontConfiguration(stubExplorerTreeVM); fileFontConfiguration.FontWeight = FontWeights.Black; Assert.AreEqual(FontWeights.Black, fileFontConfiguration.FontWeight); }
public void FontStyle_SetGet_ReturnsSetValue() { FakeExplorerTreeViewModel stubExplorerTreeVM = CreateFakeExplorerTreeVM(); FileFontConfiguration fileFontConfiguration = new FileFontConfiguration(stubExplorerTreeVM); fileFontConfiguration.FontStyle = FontStyles.Oblique; Assert.AreEqual(FontStyles.Oblique, fileFontConfiguration.FontStyle); }
public void FontStretch_SetGet_ReturnsSetValue() { FakeExplorerTreeViewModel stubExplorerTreeVM = CreateFakeExplorerTreeVM(); FileFontConfiguration fileFontConfiguration = new FileFontConfiguration(stubExplorerTreeVM); fileFontConfiguration.FontStretch = FontStretches.Expanded; Assert.AreEqual(FontStretches.Expanded, fileFontConfiguration.FontStretch); }
public void FontSize_SetGet_ReturnsSetValue() { FakeExplorerTreeViewModel stubExplorerTreeVM = CreateFakeExplorerTreeVM(); FileFontConfiguration fileFontConfiguration = new FileFontConfiguration(stubExplorerTreeVM); fileFontConfiguration.FontSize = 500; Assert.AreEqual(500, fileFontConfiguration.FontSize); }
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); }
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); } }
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); } }
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); } }
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); } }
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); } }