public void FilterWithTruePredicate() { var mate = new TestableMultiAssemblyTestEnvironment(); var assembly1 = mate.Load(CreateStubExecutor()); var assembly2 = mate.Load(CreateStubExecutor("assembly", "config")); var tests = mate.EnumerateTestMethods(testMethod => true); Assert.Equal(8, tests.Count()); Assert.True(tests.Any(tm => tm.TestClass.TestAssembly == assembly1 && tm.DisplayName == "ThisIsTheType.NonSkipMethod")); Assert.True(tests.Any(tm => tm.TestClass.TestAssembly == assembly1 && tm.DisplayName == "ThisIsTheType.SkipMethod")); Assert.True(tests.Any(tm => tm.TestClass.TestAssembly == assembly1 && tm.DisplayName == "This is a custom display name")); Assert.True(tests.Any(tm => tm.TestClass.TestAssembly == assembly1 && tm.DisplayName == "Monkey.DummyMethod")); Assert.True(tests.Any(tm => tm.TestClass.TestAssembly == assembly2 && tm.DisplayName == "ThisIsTheType.NonSkipMethod")); Assert.True(tests.Any(tm => tm.TestClass.TestAssembly == assembly2 && tm.DisplayName == "ThisIsTheType.SkipMethod")); Assert.True(tests.Any(tm => tm.TestClass.TestAssembly == assembly2 && tm.DisplayName == "This is a custom display name")); Assert.True(tests.Any(tm => tm.TestClass.TestAssembly == assembly2 && tm.DisplayName == "Monkey.DummyMethod")); }
public void NullAssemblyNameThrows() { var mate = new TestableMultiAssemblyTestEnvironment(); Assert.Throws <ArgumentNullException>(() => mate.Load((string)null)); Assert.Throws <ArgumentNullException>(() => mate.Load(null, "configFile")); }
public void FilterWithFalsePredicate() { var mate = new TestableMultiAssemblyTestEnvironment(); var assembly1 = mate.Load(CreateStubExecutor()); var assembly2 = mate.Load(CreateStubExecutor("assembly", "config")); var tests = mate.EnumerateTestMethods(testMethod => false); Assert.Equal(0, tests.Count()); }
public void ReturnsLoadedAssembly() { var wrapper = CreateStubExecutor(); var mate = new TestableMultiAssemblyTestEnvironment(); var testAssembly = mate.Load(wrapper); Assert.Same(wrapper, testAssembly.ExecutorWrapper); }
public void RemovesDisposedTestAssemblies() { var wrapper = CreateStubExecutor(); var mate = new TestableMultiAssemblyTestEnvironment(); var assembly = mate.Load(wrapper); mate.Dispose(); Assert.False(mate.EnumerateTestAssemblies().Any()); }
public void DisposesTestAssembliesWhichDisposesWrapper() { var wrapper = CreateStubExecutor(); var mate = new TestableMultiAssemblyTestEnvironment(); var assembly = mate.Load(wrapper); mate.Dispose(); Assert.True(wrapper.Dispose__Called); }
public void ExecutorShouldBeDisposedOnUnload() { var wrapper = CreateStubExecutor(); var mate = new TestableMultiAssemblyTestEnvironment(); var assembly = mate.Load(wrapper); mate.Unload(assembly); Assert.True(wrapper.Dispose__Called); }
public void LoadedAssemblyIsPartOfEnumeratedAssemblyList() { var wrapper = CreateStubExecutor(); var mate = new TestableMultiAssemblyTestEnvironment(); var assembly = mate.Load(wrapper); mate.Unload(assembly); Assert.Equal(0, mate.EnumerateTestAssemblies().Count()); }
public void LoadedAssemblyIsPartOfEnumeratedAssemblyList() { var wrapper = CreateStubExecutor(); var mate = new TestableMultiAssemblyTestEnvironment(); var assembly = mate.Load(wrapper); var assemblies = mate.EnumerateTestAssemblies(); TestAssembly testAssembly = Assert.Single(assemblies); Assert.Same(assembly, testAssembly); }
public void NullExecutorWrapperThrows() { var mate = new TestableMultiAssemblyTestEnvironment(); Assert.Throws<ArgumentNullException>(() => mate.Load((IExecutorWrapper)null)); }
public void NullAssemblyNameThrows() { var mate = new TestableMultiAssemblyTestEnvironment(); Assert.Throws<ArgumentNullException>(() => mate.Load((string)null)); Assert.Throws<ArgumentNullException>(() => mate.Load(null, "configFile")); }
public void UnfilteredReturnsAllTestsFromAllClasses() { var mate = new TestableMultiAssemblyTestEnvironment(); var assembly1 = mate.Load(CreateStubExecutor()); var assembly2 = mate.Load(CreateStubExecutor("assembly", "config")); var tests = mate.EnumerateTestMethods(); Assert.Equal(8, tests.Count()); Assert.True(tests.Any(tm => tm.TestClass.TestAssembly == assembly1 && tm.DisplayName == "ThisIsTheType.NonSkipMethod")); Assert.True(tests.Any(tm => tm.TestClass.TestAssembly == assembly1 && tm.DisplayName == "ThisIsTheType.SkipMethod")); Assert.True(tests.Any(tm => tm.TestClass.TestAssembly == assembly1 && tm.DisplayName == "This is a custom display name")); Assert.True(tests.Any(tm => tm.TestClass.TestAssembly == assembly1 && tm.DisplayName == "Monkey.DummyMethod")); Assert.True(tests.Any(tm => tm.TestClass.TestAssembly == assembly2 && tm.DisplayName == "ThisIsTheType.NonSkipMethod")); Assert.True(tests.Any(tm => tm.TestClass.TestAssembly == assembly2 && tm.DisplayName == "ThisIsTheType.SkipMethod")); Assert.True(tests.Any(tm => tm.TestClass.TestAssembly == assembly2 && tm.DisplayName == "This is a custom display name")); Assert.True(tests.Any(tm => tm.TestClass.TestAssembly == assembly2 && tm.DisplayName == "Monkey.DummyMethod")); }
public void NullExecutorWrapperThrows() { var mate = new TestableMultiAssemblyTestEnvironment(); Assert.Throws <ArgumentNullException>(() => mate.Load((IExecutorWrapper)null)); }