public void Should_Set_LogContent_From_LogFilePath() { using (var tempFile = new ResourceTempFile("Cake.Issues.Tests.Testfiles.Build.log")) { // When var settings = new IssueProviderSettings(tempFile.FileName); // Then settings.LogFileContent.ShouldBe(tempFile.Content); } }
public void Should_Write_Content() { // Given var resourceName = "Cake.Issues.Tests.Testfiles.Build.log"; // When using (var tempFile = new ResourceTempFile(resourceName)) { // Then tempFile.Content.ShouldNotBeEmpty(); } }
public void Should_Create_Temp_File() { // Given var resourceName = "Cake.Issues.Tests.Testfiles.Build.log"; // When using (var tempFile = new ResourceTempFile(resourceName)) { // Then File.Exists(tempFile.FileName).ShouldBe(true); } }
public void Should_Set_LogFileContent_From_LogFilePath() { // Given using (var tempFile = new ResourceTempFile("Cake.Issues.InspectCode.Tests.Testfiles.inspectcode.xml")) { // When var settings = new InspectCodeIssuesSettings(tempFile.FileName); // Then settings.LogFileContent.ShouldBe(tempFile.Content); } }
public void Should_Set_LogFileContent_From_LogFilePath() { // Given var format = new JsonLogFileFormat(new FakeLog()); using (var tempFile = new ResourceTempFile("Cake.Issues.EsLint.Tests.Testfiles.JsonLogFileFormat.jsonFormatWindows.json")) { // When var settings = new EsLintIssuesSettings(tempFile.FileName, format); // Then settings.LogFileContent.ShouldBe(tempFile.Content); } }
public void Should_Set_DocRootPath_From_LogFilePath() { // Given var docRootPath = @"c:/Source/Cake.Issues/docs"; using (var tempFile = new ResourceTempFile("Cake.Issues.DocFx.Tests.Testfiles.docfx.json")) { // When var settings = new DocFxIssuesSettings(tempFile.FileName, docRootPath); // Then settings.DocRootPath.ToString().ShouldBe(docRootPath); } }
public void Should_Set_LogContent_From_LogFilePath() { // Given var docRootPath = @"c:\Source\Cake.Issues\docs"; using (var tempFile = new ResourceTempFile("Cake.Issues.DocFx.Tests.Testfiles.docfx.json")) { // When var settings = new DocFxIssuesSettings(tempFile.FileName, docRootPath); // Then settings.LogFileContent.ShouldBe(tempFile.Content); } }
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); } }
public void Should_Set_TerraformRootPath_From_ValidateOutputFilePath() { // Given var terraformRootPath = @"c:/Source/Cake.Issues/docs"; using (var tempFile = new ResourceTempFile("Cake.Issues.Terraform.Tests.Testfiles.basic.json")) { // When var settings = new TerraformIssuesSettings(tempFile.FileName, terraformRootPath); // Then settings.TerraformRootPath.ToString().ShouldBe(terraformRootPath); } }
public void Should_Set_ValidateOutput_From_ValidateOutputFilePath() { // Given var terraformRootPath = @"c:\Source\Cake.Issues\docs"; using (var tempFile = new ResourceTempFile("Cake.Issues.Terraform.Tests.Testfiles.basic.json")) { // When var settings = new TerraformIssuesSettings(tempFile.FileName, terraformRootPath); // Then settings.LogFileContent.ShouldBe(tempFile.Content); } }
public void Should_Set_LogContent_From_LogFilePath() { // Given var format = new FakeLogFileFormat(new FakeLog()); using (var tempFile = new ResourceTempFile("Cake.Issues.Tests.Testfiles.Build.log")) { // When var settings = new FakeMultiFormatIssueProviderSettings(tempFile.FileName, format); // Then settings.LogFileContent.ShouldBe(tempFile.Content); } }
public void Should_Remove_Temp_File() { // Given var resourceName = "Cake.Issues.Tests.Testfiles.Build.log"; string tempFileName; // When using (var tempFile = new ResourceTempFile(resourceName)) { tempFileName = tempFile.FileName; } // Then File.Exists(tempFileName).ShouldBe(false); }
public void Should_Throw_If_Format_For_LogFilePath_Is_Null() { // Given BaseEsLintLogFileFormat format = null; using (var tempFile = new ResourceTempFile("Cake.Issues.EsLint.Tests.Testfiles.JsonLogFileFormat.jsonFormatWindows.json")) { // When var result = Record.Exception(() => new EsLintIssuesSettings(tempFile.FileName, format)); // Then result.IsArgumentNullException("format"); } }
public void Should_Throw_If_DocRootPath_For_LogFilePath_Is_Null() { // Given DirectoryPath docRootPath = null; using (var tempFile = new ResourceTempFile("Cake.Issues.DocFx.Tests.Testfiles.docfx.json")) { // When var result = Record.Exception(() => new DocFxIssuesSettings(tempFile.FileName, docRootPath)); // Then result.IsArgumentNullException("docRootPath"); } }
public void Should_Throw_If_Format_For_LogFilePath_Is_Null() { // Given BaseMsBuildLogFileFormat format = null; using (var tempFile = new ResourceTempFile("Cake.Issues.MsBuild.Tests.Testfiles.XmlFileLoggerLogFileFormat.FullLog.xml")) { // When var result = Record.Exception(() => new MsBuildIssuesSettings(tempFile.FileName, format)); // Then result.IsArgumentNullException("format"); } }
public void Should_Throw_If_TerraformRootPath_For_ValidateOutputFilePath_Is_Null() { // Given DirectoryPath terraformRootPath = null; using (var tempFile = new ResourceTempFile("Cake.Issues.Terraform.Tests.Testfiles.basic.json")) { // When var result = Record.Exception(() => new TerraformIssuesSettings(tempFile.FileName, terraformRootPath)); // Then result.IsArgumentNullException("terraformRootPath"); } }