Skip to content

Commit

Permalink
[Update] HtmlReportGeneratorTestFixture to generate a report for UML …
Browse files Browse the repository at this point in the history
…and for SySML2
  • Loading branch information
samatstariongroup committed Nov 17, 2024
1 parent 8a2b75f commit d3617c3
Showing 1 changed file with 17 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,9 @@ public class HtmlReportGeneratorTestFixture

private HtmlReportGenerator htmlReportGenerator;

private string modelPath;
private FileInfo umlModelFileInfo;

private FileInfo modelFileInfo;

private FileInfo reportFileInfo;
private FileInfo sysml2ModelFileInfo;

[OneTimeSetUp]
public void OneTimeSetUp()
Expand All @@ -60,19 +58,28 @@ public void OneTimeSetUp()
[SetUp]
public void SetUp()
{
this.modelPath = Path.Combine(TestContext.CurrentContext.TestDirectory, "TestData", "UML.xmi");
this.modelFileInfo = new FileInfo(modelPath);
this.umlModelFileInfo = new FileInfo(Path.Combine(TestContext.CurrentContext.TestDirectory, "TestData", "UML.xmi"));
this.sysml2ModelFileInfo = new FileInfo(Path.Combine(TestContext.CurrentContext.TestDirectory, "TestData", "SysML.uml"));
}

[Test]
public void Verify_that_the_report_generator_generates_a_report_of_uml()
{
this.htmlReportGenerator = new HtmlReportGenerator(this.loggerFactory);

var reportPath = Path.Combine(TestContext.CurrentContext.TestDirectory, "html-report.html");
this.reportFileInfo = new FileInfo(reportPath);
var reportFileInfo = new FileInfo(Path.Combine(TestContext.CurrentContext.TestDirectory, "uml-html-report.html"));

Assert.That(() => this.htmlReportGenerator.GenerateReport(this.umlModelFileInfo, reportFileInfo), Throws.Nothing);
}

[Test]
public void Verify_that_the_report_generator_generates_a_report()
public void Verify_that_the_report_generator_generates_a_report_of_sysml2()
{
this.htmlReportGenerator = new HtmlReportGenerator(this.loggerFactory);

Assert.That(() => this.htmlReportGenerator.GenerateReport(modelFileInfo, reportFileInfo), Throws.Nothing);
var reportFileInfo = new FileInfo(Path.Combine(TestContext.CurrentContext.TestDirectory, "sysml2-html-report.html"));

Assert.That(() => this.htmlReportGenerator.GenerateReport(this.sysml2ModelFileInfo, reportFileInfo), Throws.Nothing);
}
}
}

0 comments on commit d3617c3

Please sign in to comment.