Exemplo n.º 1
0
        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());
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
        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
            }
        }
Exemplo n.º 4
0
        public void GetDirectoryPathTest()
        {
            var result = NitPath.GetObjectDirectoryPath(new byte[] { 0x01, 0x02, 0x03, 0x04 });

            Assert.Equal(Path.Combine(".", $"{nameof(NitPathTests)}", "obj", "0102"), result);
        }
Exemplo n.º 5
0
        public void GetFileNameTest()
        {
            var result = NitPath.GetFileName(new byte[] { 0x01, 0x02, 0x03, 0x04 });

            Assert.Equal("0304", result);
        }
Exemplo n.º 6
0
        public void GetDirTest()
        {
            var result = NitPath.GetDir(new byte[] { 0x01, 0x02, 0x03, 0x04 });

            Assert.Equal("0102", result);
        }
Exemplo n.º 7
0
        public void GetBlobRootTest()
        {
            var result = NitPath.GetBlobRoot("obj");

            Assert.Equal(Path.Join(".", $"{nameof(NitPathTests)}", "obj"), result);
        }