Example #1
0
        public void DifferentLanguageTest() {
            var srcmlObject = new SrcDiffRunner(Path.Combine("..\\..\\External\\", "SrcDiff"));

            var doc = srcmlObject.GenerateSrcDiffFromFile("srcmltest\\CSHARP.cs", "srcmltest\\CSHARP.cs", "srcml_xml\\differentlanguage_java.xml", Language.Java);

            Assert.IsNotNull(doc);
        }
Example #2
0
        public void InvalidLanguageTest() {
            var srcmlObject = new SrcDiffRunner(Path.Combine("..\\..\\External\\", "SrcDiff"));

            var doc = srcmlObject.GenerateSrcDiffFromFile("srcmltest\\foo.c", "srcmltest\\foo.c", "srcml_xml\\invalidlanguage_java.xml", Language.Java);
            Assert.IsNotNull(doc);

            doc = null;
            doc = srcmlObject.GenerateSrcDiffFromFile("srcmltest\\foo.c", "srcmltest\\foo.c", "srcml_xml\\invalidlanguage_cpp.xml", Language.CPlusPlus);
            Assert.IsNotNull(doc);

            doc = null;
            doc = srcmlObject.GenerateSrcDiffFromFile("srcmltest\\foo.c", "srcmltest\\foo.c", "srcml_xml\\invalidlanguage_c.xml", Language.C);

            Assert.IsNotNull(doc);
        }
Example #3
0
 public void MyTestMethod() {
     var runner = new SrcDiffRunner(Path.Combine("..\\..\\External\\", "SrcDiff"));
     runner.GenerateSrcDiffFromFile("srcmltest\\File with spaces.cpp", "srcmltest\\File with spaces.cpp", "testfile.xml");
 }
Example #4
0
        public void InputWithSpacesTest() {
            var runner = new SrcDiffRunner(Path.Combine("..\\..\\External\\", "SrcDiff"));
            var doc = runner.GenerateSrcDiffFromFile("srcmltest\\File with spaces.cpp", "srcmltest\\File with spaces.cpp", "srcml_xml\\input_with_spaces.xml");

            Assert.IsNotNull(doc);
            Assert.AreEqual(1, doc.FileUnits.Count());
        }
Example #5
0
        public void EmptyOutputFileTest() {
            var srcmlObject = new SrcDiffRunner(Path.Combine("..\\..\\External\\", "SrcDiff"));
            File.WriteAllText("srcml_xml\\emptyFile.xml", "");
            Assert.IsTrue(File.Exists("srcml_xml\\emptyFile.xml"));

            var doc = srcmlObject.GenerateSrcDiffFromFile("srcmltest\\foo.c", "srcmltest\\foo.c", "srcml_xml\\emptyFile.xml");

            Assert.IsNotNull(doc);
            Assert.AreEqual(1, doc.FileUnits.Count());
        }
Example #6
0
        public void SingleFileTest() {
            var srcmlObject = new SrcDiffRunner(Path.Combine("..\\..\\External\\", "SrcDiff"));

            var doc = srcmlObject.GenerateSrcDiffFromFile("srcmltest\\foo.c", "srcmltest\\foo.c", "srcml_xml\\singlefile.xml");

            Assert.IsNotNull(doc);
            Assert.AreEqual(1, doc.FileUnits.Count());
            Assert.AreEqual("srcmltest\\foo.c", doc.FileUnits.First().Attribute("filename").Value);
        }