コード例 #1
0
        public void Parse_NoErrorIfNoAttributeTestClass_Test()
        {
            const string filecontent = @"
 public class Sample
 {
    [TestMethod]
    public void FooMethod_Descr()
    {
    }
 }";
            var          target      = new ClassAnalyzer(filecontent);

            target.Parse();
            Assert.IsFalse(target.Error.Any());
        }
コード例 #2
0
        public void Parse_NoErrorIfContaintPostfix_Test()
        {
            const string filecontent = @"
 [TestClass]
 public class Sample
 {
    [TestMethod]
    public void FooMethod_Descr_Test()
    {
    }
 }";
            var          target      = new ClassAnalyzer(filecontent);

            target.Parse();
            Assert.IsFalse(target.Error.Any());
        }
コード例 #3
0
        public void Parse_ErrorIfNotContaintPostfix_Test()
        {
            const string filecontent   = @"
 [TestClass]
 public class Sample
 {
    [TestMethod]
    public void FooMethod()
    {
    }
 }";
            const string expectedError = "FooMethod";
            var          target        = new ClassAnalyzer(filecontent);

            target.Parse();
            Assert.IsTrue(target.Error.Contains(expectedError));
        }
コード例 #4
0
        public void Parse_ErrorIfContaintSymbolsAfterPostfix_Test()
        {
            const string filecontent = @"
 [TestClass]
 public class Sample
 {
    [TestMethod]
    public void FooMethod_Descr_Test2()
    {
    }
 }";
            const string expected    = "FooMethod_Descr_Test2";
            var          target      = new ClassAnalyzer(filecontent);

            target.Parse();
            Assert.IsTrue(target.Error.Contains(expected));
        }