public void Should_produce_xml()
        {
            var plugins = new List<Plugin>();
            var options = new RunOptions();
            plugins.Add(new Plugin(@"C:\Some\Path\Assembly.dll", "This.Is.Full.Type.Name.For.Class.Implementing.IAutoTestNetTestRunner"));
            plugins.Add(new Plugin(@"C:\Some\Path\Assembly.dll", "Some.Class.Name"));

            var runner1 = new RunnerOptions("nunit");
            runner1.AddCategories(new string[] { "SomeTestCategory", "SomeOtherTestCategory" });
            var assembly1 = new AssemblyOptions(@"C:\my\testassembly.dll");
            assembly1.HasBeenVerified(true);
            assembly1.AddTests(new string[] { "testassembly.class.test1", "testassembly.class.test2" });
            assembly1.AddMembers(new string[] { "testassembly.class2", "testassembly.class3" });
            assembly1.AddNamespaces(new string[] { "testassembly.somenamespace1", "testassembly.somenamespace2" });
            runner1.AddAssemblies(new AssemblyOptions[] { assembly1, new AssemblyOptions(@"C:\my\anothernunitassembly.dll") });
            options.AddTestRun(runner1);

            var runner2 = new RunnerOptions("another");
            runner2.AddAssembly(new AssemblyOptions(@"C:\my\other\testassembly.dll"));
            options.AddTestRun(runner2);
            
            var writer = new OptionsXmlWriter(plugins, options);
            var file = Path.GetTempFileName();
            writer.Write(file);

            var path = Path.GetDirectoryName(new Uri(Assembly.GetExecutingAssembly().CodeBase).LocalPath);
            var original = File.ReadAllText(file).Replace("\r\n", "\n");
            var generated = File.ReadAllText(Path.Combine(path, "TestOptionsCorrected.xml")).Replace("\r\n", "\n");
            Assert.That(original, Is.EqualTo(generated));
        }
        private RunnerOptions getRunnerOptions(IEnumerable<TestRunInfo> unitInfos, IAutoTestNetTestRunner instance)
        {
            DebugLog.Debug.WriteDetail("Getting runner options for {0}", instance.Identifier);
            var runner = new RunnerOptions(instance.Identifier);
            runner.AddCategories(_configuration.TestCategoriesToIgnore);
            var testRunner = TestRunnerConverter.FromString(instance.Identifier);
            foreach (var info in unitInfos)
            {
				DebugLog.Debug.WriteDetail("Handling {0}", info.Assembly);
				DebugLog.Debug.WriteDetail("About to add assembly");
                var assembly = new AssemblyOptions(info.Assembly);
                assembly.HasBeenVerified(true);
                assembly.AddTests(info.GetTestsFor(testRunner));
                DebugLog.Debug.WriteDetail("Found {0} tests for assembly", assembly.Tests.Count());
                assembly.AddMembers(info.GetMembersFor(testRunner));
                DebugLog.Debug.WriteDetail("Found {0} members for assembly", assembly.Members.Count());
                assembly.AddNamespaces(info.GetNamespacesFor(testRunner));
                DebugLog.Debug.WriteDetail("Found {0} namespaces for assembly", assembly.Namespaces.Count());
                DebugLog.Debug.WriteDetail("Run only specified tests for runner {0} is {1}", testRunner, info.OnlyRunSpcifiedTestsFor(testRunner));
                if (info.OnlyRunSpcifiedTestsFor(testRunner) && assembly.Tests.Count() == 0 && assembly.Members.Count() == 0 && assembly.Namespaces.Count() == 0)
                    continue;
				DebugLog.Debug.WriteDetail("Adding assembly");
                runner.AddAssembly(assembly);
            }
            return runner;
        }