Пример #1
0
 public void Should_find_inherited_attributes_in_methods()
 {
     var locator = new SimpleTypeLocator(new Uri(Assembly.GetExecutingAssembly().CodeBase).LocalPath, "AutoTest.TestRunners.Tests.AssemblyAnalysis.BaseClass.Blargh");
     var cls = locator.Locate();
     Assert.AreEqual("AutoTest.TestRunners.Tests.AssemblyAnalysis.BaseClass.Blargh", cls.Fullname);
     Assert.AreEqual(3, cls.Attributes.Count());
 }
Пример #2
0
 public void Should_find_inherited_attributes()
 {
     var locator = new SimpleTypeLocator(new Uri(Assembly.GetExecutingAssembly().CodeBase).LocalPath, "AutoTest.TestRunners.Tests.AssemblyAnalysis.TypeLocatorTests");
     var cls = locator.Locate();
     Assert.AreEqual("AutoTest.TestRunners.Tests.AssemblyAnalysis.TypeLocatorTests", cls.Fullname);
     Assert.AreEqual("AutoTest.TestRunners.Tests.AssemblyAnalysis.MyAttribute", cls.Attributes.ElementAt(1));
 }
Пример #3
0
 public bool ContainsTestsFor(string assembly, string member)
 {
     var locator = new SimpleTypeLocator(assembly, member);
     var cls = locator.Locate();
     if (cls.Category != TypeCategory.Class)
         return false;
     return cls.Attributes.Contains("Microsoft.VisualStudio.TestTools.UnitTesting.TestClassAttribute");
 }
Пример #4
0
 public bool IsTest(string assembly, string member)
 {
     var locator = new SimpleTypeLocator(assembly, member);
     var method = locator.Locate();
     if (method.Category != TypeCategory.Method)
         return false;
     return method.Attributes.Contains("Microsoft.VisualStudio.TestTools.UnitTesting.TestMethodAttribute");
 }
Пример #5
0
 public bool ContainsTestsFor(string assembly, string member)
 {
     var locator = new SimpleTypeLocator(assembly, member);
     var cls = locator.Locate();
     if (cls.Category != TypeCategory.Class)
         return false;
     return cls.Attributes.Contains("NUnit.Framework.TestFixtureAttribute");
 }
Пример #6
0
 public bool IsTest(string assembly, string member)
 {
     var locator = new SimpleTypeLocator(assembly, member);
     var method = locator.Locate();
     if (method.Category != TypeCategory.Method)
         return false;
     return method.Attributes.Contains("NUnit.Framework.TestAttribute") || method.Attributes.Contains("NUnit.Framework.TestCaseAttribute");
 }
Пример #7
0
 public bool ContainsTestsFor(string assembly, string member)
 {
     var locator = new SimpleTypeLocator(assembly, member);
     var cls = locator.Locate();
     if (cls.Category != TypeCategory.Class)
         return false;
     return cls.Methods.Where(x => x.Attributes.Contains("Xunit.FactAttribute")).Count() > 0;
 }
Пример #8
0
 public void Should_find_me()
 {
     var locator = new SimpleTypeLocator(new Uri(Assembly.GetExecutingAssembly().CodeBase).LocalPath, "AutoTest.TestRunners.Tests.AssemblyAnalysis.TypeLocatorTests.Should_find_me");
     var method = locator.Locate();
     Assert.That(method.Category, Is.EqualTo(TypeCategory.Method));
     Assert.AreEqual("AutoTest.TestRunners.Tests.AssemblyAnalysis.TypeLocatorTests.Should_find_me", method.Fullname);
     Assert.AreEqual("NUnit.Framework.TestAttribute", method.Attributes.ElementAt(0));
     Assert.AreEqual(0, method.Methods.Count());
 }
Пример #9
0
 public bool IsTest(string assembly, string member)
 {
     var locator = new SimpleTypeLocator(assembly, member);
     var method = locator.Locate();
     if (method == null)
         return false;
     if (method.Category != TypeCategory.Method)
         return false;
     return method.Attributes.Contains("Xunit.FactAttribute");
 }