GetAssemblyTestCount() public method

public GetAssemblyTestCount ( ) : int
return int
Ejemplo n.º 1
0
        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());
            }
        }
Ejemplo n.º 2
0
        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());
            }
        }