Exemple #1
0
            public void Should_Return_The_Same_Configuration()
            {
                // Given
                var settings = new DotNetCoreMSBuildSettings();

                // When
                var result = settings.SetVersionSuffix(VersionSuffix);

                // Then
                Assert.Equal(settings, result);
            }
Exemple #2
0
            public void Should_Return_The_Same_Configuration()
            {
                // Given
                var settings = new DotNetCoreMSBuildSettings();

                // When
                var result = settings.WithDistributedLogger(new MSBuildDistributedLogger());

                // Then
                Assert.Equal(settings, result);
            }
Exemple #3
0
            public void Should_Return_The_Same_Configuration()
            {
                // Given
                var settings = new DotNetCoreMSBuildSettings();

                // When
                var result = settings.TreatAllWarningsAs(MSBuildTreatAllWarningsAs.Error);

                // Then
                Assert.Equal(settings, result);
            }
Exemple #4
0
            public void Should_Return_The_Same_Configuration()
            {
                // Given
                var settings = new DotNetCoreMSBuildSettings();

                // When
                var result = settings.SuppressVersionRecommendedFormatWarning();

                // Then
                Assert.Equal(settings, result);
            }
Exemple #5
0
            public void Should_Add_Warning_Code_To_Configuration()
            {
                // Given
                var settings = new DotNetCoreMSBuildSettings();

                // When
                settings.SetWarningCodeAsMessage("ERR1");

                // Then
                Assert.True(settings.WarningCodesAsMessage.Contains("ERR1"));
            }
Exemple #6
0
            public void Should_Throw_Exception_If_Null_Or_Whitespace(string warningCode)
            {
                // Given
                var settings = new DotNetCoreMSBuildSettings();

                // When
                var result = Record.Exception(() => settings.SetWarningCodeAsMessage(warningCode));

                // Then
                AssertEx.IsArgumentException(result, "warningCode", "Warning code cannot be null or empty");
            }
Exemple #7
0
            public void Should_Set_No_Logo()
            {
                // Given
                var settings = new DotNetCoreMSBuildSettings();

                // When
                settings.HideLogo();

                // Then
                Assert.True(settings.NoLogo);
            }
Exemple #8
0
            public void Should_Return_The_Same_Configuration()
            {
                // Given
                var settings = new DotNetCoreMSBuildSettings();

                // When
                var result = settings.DisableConsoleLogger();

                // Then
                Assert.Equal(settings, result);
            }
Exemple #9
0
            public void Should_Add_Target_To_Configuration()
            {
                // Given
                var settings = new DotNetCoreMSBuildSettings();

                // When
                settings.WithTarget("Target");

                // Then
                Assert.True(settings.Targets.Contains("Target"));
            }
Exemple #10
0
            public void Should_Set_Exclude_Auto_Response_Files()
            {
                // Given
                var settings = new DotNetCoreMSBuildSettings();

                // When
                settings.ExcludeAutoResponseFiles();

                // Then
                Assert.True(settings.ExcludeAutoResponseFiles);
            }
Exemple #11
0
            public void Should_Set_MaxCpuCount_To_Zero_If_Negative_Value()
            {
                // Given
                var settings = new DotNetCoreMSBuildSettings();

                // When
                settings.SetMaxCpuCount(-1);

                // Then
                Assert.Equal(0, settings.MaxCpuCount);
            }
Exemple #12
0
            public void Should_Set_MaxCpuCount()
            {
                // Given
                var settings = new DotNetCoreMSBuildSettings();

                // When
                settings.SetMaxCpuCount(4);

                // Then
                Assert.Equal(4, settings.MaxCpuCount);
            }
Exemple #13
0
            public void Should_Return_The_Same_Configuration()
            {
                // Given
                var settings = new DotNetCoreMSBuildSettings();

                // When
                var result = settings.WithIgnoredProjectExtension(".sln");

                // Then
                Assert.Equal(settings, result);
            }
Exemple #14
0
            public void Should_Add_Ignored_Extension_To_Configuration()
            {
                // Given
                var settings = new DotNetCoreMSBuildSettings();

                // When
                settings.WithIgnoredProjectExtension(".sln");

                // Then
                Assert.True(settings.IgnoreProjectExtensions.Contains(".sln"));
            }
Exemple #15
0
            public void Should_Set_Tool_Version()
            {
                // Given
                var settings = new DotNetCoreMSBuildSettings();

                // When
                settings.UseToolVersion(MSBuildVersion.MSBuild35);

                // Then
                Assert.Equal(MSBuildVersion.MSBuild35, settings.ToolVersion);
            }
Exemple #16
0
            public void Should_Set_Disable_Console_Logger()
            {
                // Given
                var settings = new DotNetCoreMSBuildSettings();

                // When
                settings.DisableConsoleLogger();

                // Then
                Assert.True(settings.DisableConsoleLogger);
            }
Exemple #17
0
            public void Should_Return_The_Same_Configuration()
            {
                // Given
                var settings = new DotNetCoreMSBuildSettings();

                // When
                var result = settings.UseToolVersion(MSBuildVersion.MSBuild35);

                // Then
                Assert.Equal(settings, result);
            }
Exemple #18
0
            public void Should_Return_The_Same_Configuration()
            {
                // Given
                var settings = new DotNetCoreMSBuildSettings();

                // When
                var result = settings.WithProperty("PropertyName", "Value");

                // Then
                Assert.Equal(settings, result);
            }
Exemple #19
0
            public void Should_Set_Validate_Project_File()
            {
                // Given
                var settings = new DotNetCoreMSBuildSettings();

                // When
                settings.ValidateProjectFile();

                // Then
                Assert.True(settings.ValidateProjectFile);
            }
Exemple #20
0
            public void Should_Return_The_Same_Configuration()
            {
                // Given
                var settings = new DotNetCoreMSBuildSettings();

                // When
                var result = settings.SetWarningCodeAsMessage("ERR1");

                // Then
                Assert.Equal(settings, result);
            }
Exemple #21
0
            public void Should_Return_The_Same_Configuration()
            {
                // Given
                var settings = new DotNetCoreMSBuildSettings();

                // When
                var result = settings.ValidateProjectFile();

                // Then
                Assert.Equal(settings, result);
            }
Exemple #22
0
            public void Should_Set_Warning_Code_Behaviour(MSBuildTreatAllWarningsAs treatAllAs)
            {
                // Given
                var settings = new DotNetCoreMSBuildSettings();

                // When
                settings.TreatAllWarningsAs(treatAllAs);

                // Then
                Assert.Equal(treatAllAs, settings.TreatAllWarningsAs);
            }
Exemple #23
0
            public void Should_Return_The_Same_Configuration()
            {
                // Given
                var settings = new DotNetCoreMSBuildSettings();

                // When
                var result = settings.WithResponseFile(".sln");

                // Then
                Assert.Equal(settings, result);
            }
Exemple #24
0
            public void Should_Set_Detailed_Summary()
            {
                // Given
                var settings = new DotNetCoreMSBuildSettings();

                // When
                settings.ShowDetailedSummary();

                // Then
                Assert.True(settings.DetailedSummary);
            }
Exemple #25
0
            public void Should_Set_Distributed_File_Logger()
            {
                // Given
                var settings = new DotNetCoreMSBuildSettings();

                // When
                settings.UseDistributedFileLogger();

                // Then
                Assert.True(settings.DistributedFileLogger);
            }
Exemple #26
0
            public void Should_Return_The_Same_Configuration()
            {
                // Given
                var settings = new DotNetCoreMSBuildSettings();

                // When
                var result = settings.ShowDetailedSummary();

                // Then
                Assert.Equal(settings, result);
            }
Exemple #27
0
            public void Should_Add_Property_To_Configuration()
            {
                // Given
                var settings = new DotNetCoreMSBuildSettings();

                // When
                settings.WithProperty("PropertyName", "Value");

                // Then
                Assert.True(settings.Properties.ContainsKey("PropertyName"));
            }
            public void Should_Return_The_Same_Configuration()
            {
                // Given
                var settings = new DotNetCoreMSBuildSettings();

                // When
                var result = settings.SetTargetFramework(TargetFramework);

                // Then
                Assert.Equal(settings, result);
            }
            public void Should_Add_VersionSuffix_Property_To_Configuration()
            {
                // Given
                var settings = new DotNetCoreMSBuildSettings();

                // When
                settings.VersionSuffix = "test";

                // Then
                Assert.True(settings.Properties.ContainsKey("VersionSuffix"));
                Assert.True(settings.Properties["VersionSuffix"].Contains("test"));
            }
            public void Should_Add_PackageReleaseNotes_Property_To_Configuration()
            {
                // Given
                var settings = new DotNetCoreMSBuildSettings();

                // When
                settings.PackageReleaseNotes = "https://...";

                // Then
                Assert.True(settings.Properties.ContainsKey("PackageReleaseNotes"));
                Assert.True(settings.Properties["PackageReleaseNotes"].Contains("https://..."));
            }