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()); }
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)); }
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"); }
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"); }
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"); }
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"); }
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; }
public void Should_find_my_parent() { var locator = new SimpleTypeLocator(new Uri(Assembly.GetExecutingAssembly().CodeBase).LocalPath, "AutoTest.TestRunners.Tests.AssemblyAnalysis.TypeLocatorTests.Should_find_me"); var cls = locator.LocateParent(); Assert.That(cls.Category, Is.EqualTo(TypeCategory.Class)); Assert.AreEqual("AutoTest.TestRunners.Tests.AssemblyAnalysis.TypeLocatorTests", cls.Fullname); Assert.AreEqual("NUnit.Framework.TestFixtureAttribute", cls.Attributes.ElementAt(0)); Assert.AreEqual(5, cls.Methods.Count()); }
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()); }
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"); }