Skip to content

Commit

Permalink
test: Added test for output format
Browse files Browse the repository at this point in the history
  • Loading branch information
kamil-mrzyglod committed Sep 2, 2024
1 parent 7fdbee8 commit 3484be1
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions ace-tests/Reworked/OutputTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,28 @@ public void Output_WhenHtmlOutputIsRequested_ItShouldGenerateWithoutError()

Assert.That(outputFile, Is.Not.Null);
}

[Test]
public void Output_WhenTableOutputFormatIsSet_ItShouldGenerateWithoutError()
{
var outputFilename = $"ace_test_{DateTime.Now.Ticks}.json";
var exitCode = Program.Main([
"templates/reworked/automation-account/automation-account.bicep",
"cf70b558-b930-45e4-9048-ebcefb926adf",
"arm-estimator-tests-rg",
"--generateJsonOutput",
"--jsonOutputFilename",
outputFilename,
"--outputFormat",
"Table",
"--mocked-retail-api-response-path",
"mocked-responses/retail-api/automation-account/usage-patterns.json"
]);

Assert.That(exitCode, Is.EqualTo(0));

var outputFile = File.ReadAllText(outputFilename);

Assert.That(outputFile, Is.Not.Null);
}
}

0 comments on commit 3484be1

Please sign in to comment.