public void Should_Set_LogFileContent_If_Empty() { // Given byte[] logFileContent = Array.Empty <byte>(); var format = new MarkdownlintV1LogFileFormat(new FakeLog()); // When var settings = new MarkdownlintIssuesSettings(logFileContent, format); // Then settings.LogFileContent.ShouldBe(logFileContent); }
public void Should_Set_LogFileContent() { // Given var logFileContent = "Foo".ToByteArray(); var format = new MarkdownlintV1LogFileFormat(new FakeLog()); // When var settings = new MarkdownlintIssuesSettings(logFileContent, format); // Then settings.LogFileContent.ShouldBe(logFileContent); }
public void Should_Throw_If_LogFileContent_Is_Null() { // Given byte[] logFileContent = null; var format = new MarkdownlintV1LogFileFormat(new FakeLog()); // When var result = Record.Exception(() => new MarkdownlintIssuesSettings(logFileContent, format)); // Then result.IsArgumentNullException("logFileContent"); }
public void Should_Set_LogFileContent_From_LogFilePath() { // Given var format = new MarkdownlintV1LogFileFormat(new FakeLog()); using (var tempFile = new ResourceTempFile("Cake.Issues.Markdownlint.Tests.Testfiles.MarkdownlintV1LogFileFormat.markdownlint.json")) { // When var settings = new MarkdownlintIssuesSettings(tempFile.FileName, format); // Then settings.LogFileContent.ShouldBe(tempFile.Content); } }