public void Initialize() { Assembly assembly = Assembly.GetExecutingAssembly(); foreach (Type type in assembly.GetTypes()) { TestFixtureAttribute fixtureAttribute = type.GetCustomAttribute <TestFixtureAttribute>(); if (fixtureAttribute == null) { continue; } object fixtureInstance = Activator.CreateInstance(type); TestClassCommand classCommand = new TestClassCommand(fixtureInstance); foreach (MethodInfo method in type.GetMethods()) { TestAttribute testAttribute = method.GetCustomAttribute <TestAttribute>(); if (testAttribute == null) { continue; } TestMethodCommand methodCommand = new TestMethodCommand(method) { Iterations = testAttribute.Iterations, PartitionCount = testAttribute.PartitionCount }; string methodName = method.Name.Replace("Tests", string.Empty).Replace("Test", string.Empty).ToLower(); classCommand.AddTestMethodCommand(methodName, methodCommand); } testClassCommands.Add(type.Name.ToLower(), classCommand); } }