예제 #1
0
        public void FindInSolution()
        {
            Tsconfig[] results   = TsconfigLocations.FindInSolution(solution).ToArray();
            string     expected1 = Path.GetFullPath(@"../../artifacts/tsconfig/multiple/tsconfig.json");
            string     expected2 = Path.GetFullPath(@"../../artifacts/tsconfig/multiple/a/tsconfig.json");
            string     expected3 = Path.GetFullPath(@"../../artifacts/tsconfig/multiple/b/tsconfig.json");

            Assert.AreEqual(3, results.Length);
            Assert.IsTrue(Contains(results, expected1));
            Assert.IsTrue(Contains(results, expected2));
            Assert.IsTrue(Contains(results, expected3));
        }
예제 #2
0
 public void FindInSolutionIgnorePath()
 {
     settings.IgnorePatterns = new string[] { @"\multiple\a\" };
     try
     {
         Tsconfig[] results   = TsconfigLocations.FindInSolution(solution).ToArray();
         string     expected1 = Path.GetFullPath(@"../../artifacts/tsconfig/multiple/tsconfig.json");
         string     expected2 = Path.GetFullPath(@"../../artifacts/tsconfig/multiple/a/tsconfig.json");
         string     expected3 = Path.GetFullPath(@"../../artifacts/tsconfig/multiple/b/tsconfig.json");
         Assert.AreEqual(2, results.Length);
         Assert.IsTrue(Contains(results, expected1));
         Assert.IsFalse(Contains(results, expected2));  // IsFalse test: the file has been excluded
         Assert.IsTrue(Contains(results, expected3));
     }
     finally
     {
         settings.IgnorePatterns = new string[0];
     }
 }
예제 #3
0
 public void FindInSolutionIncludeNested()
 {
     settings.IgnoreNestedFiles = false;
     try
     {
         Tsconfig[] results   = TsconfigLocations.FindInSolution(solution).ToArray();
         string     expected1 = Path.GetFullPath(@"../../artifacts/tsconfig/multiple/tsconfig.json");
         string     expected2 = Path.GetFullPath(@"../../artifacts/tsconfig/multiple/a/tsconfig.json");
         string     expected3 = Path.GetFullPath(@"../../artifacts/tsconfig/multiple/b/tsconfig.json");
         // Nested tsconfig in tsconfigEmptyTest
         string expected4 = Path.GetFullPath(@"../../artifacts/tsconfig/none/tsconfig.json");
         // C:\Source\typescript-analyzer2\src\WebLinterTest\artifacts\tsconfig\none\tsconfig.json
         Assert.AreEqual(4, results.Length);
         Assert.IsTrue(Contains(results, expected1));
         Assert.IsTrue(Contains(results, expected2));
         Assert.IsTrue(Contains(results, expected3));
         Assert.IsTrue(Contains(results, expected4));
     }
     finally
     {
         settings.IgnoreNestedFiles = true;
     }
 }