public void Ctor_EmptyInf_Discription_Is_Null() { MockFileSystem fileSystem = new MockFileSystem(new Dictionary <string, MockFileData> { { @"C:\driver\path1\path2\display\component1\driver.inf", new MockFileData(string.Empty) } }); IDirectoryInfo rootDir = fileSystem.DirectoryInfo.FromDirectoryName(@"C:\driver"); IDirectoryInfo componentDir = fileSystem.DirectoryInfo.FromDirectoryName(@"C:\driver\path1\path2\display\component1"); DisplayComponentModel displayComponentModel = new DisplayComponentModel(rootDir, componentDir); Assert.That(displayComponentModel.Description, Is.Null); Assert.That(displayComponentModel.Directory, Is.EqualTo(@"\path1\path2\display\component1")); Assert.That(displayComponentModel.InfFile, Is.EqualTo("driver.inf")); Assert.That(displayComponentModel.Keep, Is.True); }
public void Ctor_Missing_Strings_Discription_Is_Null() { MockFileSystem fileSystem = new MockFileSystem(new Dictionary <string, MockFileData> { { @"C:\driver\path1\path2\display\component1\driver.inf", new MockFileData( string.Format("dummyline{0}dummyline2{0}desc\"test{0}", Environment.NewLine)) } }); IDirectoryInfo rootDir = fileSystem.DirectoryInfo.FromDirectoryName(@"C:\driver"); IDirectoryInfo componentDir = fileSystem.DirectoryInfo.FromDirectoryName(@"C:\driver\path1\path2\display\component1"); DisplayComponentModel displayComponentModel = new DisplayComponentModel(rootDir, componentDir); Assert.That(displayComponentModel.Description, Is.Null); Assert.That(displayComponentModel.Directory, Is.EqualTo(@"\path1\path2\display\component1")); Assert.That(displayComponentModel.InfFile, Is.EqualTo("driver.inf")); Assert.That(displayComponentModel.Keep, Is.True); }
public void Remove_Keep_False_Does_Delete() { MockFileSystem fileSystem = new MockFileSystem(new Dictionary <string, MockFileData> { { @"C:\driver\path1\path2\display\component1\driver.inf", new MockFileData(string.Empty) } }); IDirectoryInfo rootDir = fileSystem.DirectoryInfo.FromDirectoryName(@"C:\driver"); IDirectoryInfo componentDir = fileSystem.DirectoryInfo.FromDirectoryName(@"C:\driver\path1\path2\display\component1"); DisplayComponentModel displayComponentModel = new DisplayComponentModel(rootDir, componentDir); displayComponentModel.Keep = false; displayComponentModel.Remove(); Assert.That(componentDir.Exists, Is.False); Assert.That(rootDir.Exists, Is.True); }
public DisplayComponentTemplate(DisplayComponentModel model, AngularComponentHtmlTemplate.AngularComponentHtmlTemplate template) { _template = template; Model = model; }