Exemple #1
0
    static XUnitSettings BuildXUnitSettings(ParsedProject projectUnderTest, AnyUnitTestSettings settings,
                                            DirectoryPath outputDir)
    {
        var outputFile = outputDir.CombineWithFilePath(projectUnderTest.Project.AssemblyName + ".xunit.xml");

        var traitArgs = new List <KeyValuePair <string, string> >();

        AddTraits(traitArgs, "/-trait", settings.ExcludedTraits);
        AddTraits(traitArgs, "/trait", settings.IncludedTraits);

        var s = new XUnitSettings();

        XBuildHelper.ApplyToolSettings(s, NUnitToolArgs);
        s.ShadowCopy            = settings.ShadowCopyAssemblies;
        s.ArgumentCustomization = args =>
        {
            foreach (var traitArg in traitArgs)
            {
                args.Append(traitArg.Key);
                args.AppendQuoted(traitArg.Value);
            }

            args.Append("/xml");
            args.AppendQuoted(outputFile.MakeAbsolute(Context.Environment).FullPath);
            return(args);
        };
        return(s);
    }
            public void Should_Disable_Silent_Mode_By_Default()
            {
                // Given, When
                var settings = new XUnitSettings();

                // Then
                Assert.False(settings.Silent);
            }
            public void Should_Enable_Shadow_Copying_By_Default()
            {
                // Given, When
                var settings = new XUnitSettings();

                // Then
                Assert.True(settings.ShadowCopy);
            }
            public void Should_Disable_HTML_Report_By_Default()
            {
                // Given, When
                var settings = new XUnitSettings();

                // Then
                Assert.False(settings.HtmlReport);
            }
            public void Should_Set_Output_Directory_To_Null_By_Default()
            {
                // Given, When
                var settings = new XUnitSettings();

                // Then
                Assert.Null(settings.OutputDirectory);
            }