public void AssemblyWithNoTests() { string code = @" public class JustAPlainOldClass { }"; using (MockAssembly assembly = new MockAssembly()) { assembly.Compile(code); using (ExecutorWrapper wrapper = new ExecutorWrapper(assembly.FileName, null, false)) Assert.Equal(0, wrapper.GetAssemblyTestCount()); } }
public void AssemblyWithMultipleTestsAndMultipleClasses() { string code = @" using Xunit; public class JustAPlainOldClass { public class Class1 { [Fact] public void Test1() {} [Fact] public void Test2() {} } public class Class2 { [Fact] public void Test3() {} } }"; using (MockAssembly assembly = new MockAssembly()) { assembly.Compile(code); using (ExecutorWrapper wrapper = new ExecutorWrapper(assembly.FileName, null, false)) Assert.Equal(3, wrapper.GetAssemblyTestCount()); } }