コード例 #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());
        }
コード例 #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);
        }
コード例 #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
            }
        }
コード例 #4
0
        public void GetDirectoryPathTest()
        {
            var result = NitPath.GetObjectDirectoryPath(new byte[] { 0x01, 0x02, 0x03, 0x04 });

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

            Assert.Equal("0304", result);
        }
コード例 #6
0
        public void GetDirTest()
        {
            var result = NitPath.GetDir(new byte[] { 0x01, 0x02, 0x03, 0x04 });

            Assert.Equal("0102", result);
        }
コード例 #7
0
        public void GetBlobRootTest()
        {
            var result = NitPath.GetBlobRoot("obj");

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