public void ShouldFailOnOpeningNonExistingTaxonomy() { Assert.Throws <FileNotFoundException>(() => { using (var t = Taxonomy.CreateNew(nonexistingPath, "test taxonomy")) { } }); }
public void ShouldFailOnCreatingNewTaxonomyWhenThePathIsAActuallyADirectory() { Assert.Throws <IOException>(() => { using (var t = Taxonomy.CreateNew(@"testdata/simpledirectory", "test taxonomy")) { } }); Assert.Throws <IOException>(() => { using (var t = Taxonomy.CreateNew(@"testdata/simpledirectory/", "test taxonomy")) { } }); }
public void ShouldFailOnCreatingNewTaxonomyWhenAFileExists() { var file = new FileInfo(@"testdata/a_file"); using (var fileStream = file.Create()) { // do nothing, let the file exist } try { Assert.Throws <IOException>(() => { using (var t = Taxonomy.CreateNew(file.FullName, "test taxonomy")) { } }); } finally { file.Delete(); } }
public void SetUp() { taxonomy = Taxonomy.CreateNew(@"testdata\test.sql"); }
public void SetUp() { taxonomy = Taxonomy.CreateNew(taxonomyRelativePath, shortName); }
public void CreateNewTaxonomy(string path, string shortName) { var taxonomyItem = new TaxonomyItem(path, p => Taxonomy.CreateNew(p, shortName)); Taxonomies.Add(taxonomyItem); }