public void it_can_select_the_current_assembly() { var sut = new AssemblySelectorExpression<TCapture>(a => new TCapture() { Assemblies = a }); var result = sut.ForThisAssembly(); Assert.That(result.Assemblies.Select(x => x.GetName().Name).ToList(), Is.EquivalentTo(new[] { "netlint.tests" })); }
public void it_can_select_a_different_assembly() { var sut = new AssemblySelectorExpression<TCapture>(a => new TCapture() { Assemblies = a }); var result = sut.ForAssemblyOf<TestAttribute>(); Assert.That(result.Assemblies.Select(x => x.GetName().Name).ToList(), Is.EquivalentTo(new[] { "nunit.framework" })); }
public void it_doesnt_return_duplicate_assemblies() { var sut = new AssemblySelectorExpression<TCapture>(a => new TCapture() { Assemblies = a }); var result = sut.ForAssembliesOf(typeof(TestAttribute), typeof(NetLint), typeof(when_selecting_assemblies), typeof(TestFixtureAttribute)); Assert.That(result.Assemblies.Select(x => x.GetName().Name).ToList(), Is.EquivalentTo(new[] { "nunit.framework", "netlint", "netlint.tests" })); }