public LookupTests() { NitPath.OverrideRootFolder(Path.Join(".", $"{nameof(LookupTests)}")); try { // make sure test area is clean Directory.Delete(NitPath.RootFolder, true); } catch { // folder probably didn't exist } // create test tags in bulk var testSet = File.ReadAllText(Path.Join(".", "Resources", "Poem.txt")); var tagSet = testSet.Split(' '); Tag.CreateTags(this.target2, tagSet); Tag.CreateTags(this.target3, tagSet); var tags = new List <string>(); tags.Add("Scoobie"); tags.Add("Doo"); tags.Add("Shaggy"); Tag.CreateTags(this.target1, tags.ToArray()); }
public void GetFullPathTest() { var result = NitPath.GetFullObjectPath(new byte[] { 0x01, 0x02, 0x03, 0x04 }); var x = Path.Combine(".", $"{nameof(NitPathTests)}", "obj", "0102", "0304"); Assert.Equal(Path.Combine(".", $"{nameof(NitPathTests)}", "obj", "0102", "0304"), result); }
public MarkdownTests() { NitPath.OverrideRootFolder(Path.Join(".", nameof(MarkdownTests))); try { // make sure test area is clean Directory.Delete(NitPath.RootFolder, true); } catch { // folder probably didn't exist } }
public void GetDirectoryPathTest() { var result = NitPath.GetObjectDirectoryPath(new byte[] { 0x01, 0x02, 0x03, 0x04 }); Assert.Equal(Path.Combine(".", $"{nameof(NitPathTests)}", "obj", "0102"), result); }
public void GetFileNameTest() { var result = NitPath.GetFileName(new byte[] { 0x01, 0x02, 0x03, 0x04 }); Assert.Equal("0304", result); }
public void GetDirTest() { var result = NitPath.GetDir(new byte[] { 0x01, 0x02, 0x03, 0x04 }); Assert.Equal("0102", result); }
public void GetBlobRootTest() { var result = NitPath.GetBlobRoot("obj"); Assert.Equal(Path.Join(".", $"{nameof(NitPathTests)}", "obj"), result); }