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 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 ContainsTestsFor(string assembly, string member) { var locator = new SimpleTypeLocator(assembly, member); var cls = locator.Locate(); if (cls == null) { return(false); } 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 == null) { return(false); } 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 == null) { return(false); } if (cls.Category != TypeCategory.Class) { return(false); } return(cls.Methods.Where(x => x.Attributes.Contains("Xunit.FactAttribute")).Count() > 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")); }
public bool ContainsTestsFor(string assembly, string member) { var locator = new SimpleTypeLocator(assembly, member); var cls = locator.Locate(); if (cls == null) { return(false); } if (cls.Category != TypeCategory.Class) { return(false); } return(cls.Attributes.Contains("NUnit.Framework.TestFixtureAttribute")); }