Example #1
0
            public void Should_Set_LogContent()
            {
                // Given
                var logFileContent = "Foo".ToByteArray();
                var format         = new XmlFileLoggerLogFileFormat(new FakeLog());

                // When
                var settings = new MsBuildIssuesSettings(logFileContent, format);

                // Then
                settings.LogFileContent.ShouldBe(logFileContent);
            }
Example #2
0
            public void Should_Throw_If_LogContent_Is_Empty()
            {
                // Given
                byte[] logFileContent = Array.Empty <byte>();
                var    format         = new XmlFileLoggerLogFileFormat(new FakeLog());

                // When
                var result = Record.Exception(() => new MsBuildIssuesSettings(logFileContent, format));

                // Then
                result.IsArgumentException("logFileContent");
            }
Example #3
0
            public void Should_Throw_If_LogFilePath_Is_Null()
            {
                // Given
                FilePath logFilePath = null;
                var      format      = new XmlFileLoggerLogFileFormat(new FakeLog());

                // When
                var result = Record.Exception(() => new MsBuildIssuesSettings(logFilePath, format));

                // Then
                result.IsArgumentNullException("logFilePath");
            }
            public void Should_Set_LogFileContent_If_Empty()
            {
                // Given
                byte[] logFileContent = Array.Empty <byte>();
                var    format         = new XmlFileLoggerLogFileFormat(new FakeLog());

                // When
                var settings = new MsBuildIssuesSettings(logFileContent, format);

                // Then
                settings.LogFileContent.ShouldBe(logFileContent);
            }
Example #5
0
            public void Should_Set_LogContent_From_LogFilePath()
            {
                // Given
                var format = new XmlFileLoggerLogFileFormat(new FakeLog());

                using (var tempFile = new ResourceTempFile("Cake.Issues.MsBuild.Tests.Testfiles.XmlFileLoggerLogFileFormat.FullLog.xml"))
                {
                    // When
                    var settings = new MsBuildIssuesSettings(tempFile.FileName, format);

                    // Then
                    settings.LogFileContent.ShouldBe(tempFile.Content);
                }
            }