using MeetTheTeacher.Export; namespace MeetTheTeacher.Test.Export; public sealed class HtmlDataExporterTests : ExporterTestBase, IDisposable { private readonly HtmlDataExporter _htmlDataExporter; public HtmlDataExporterTests() { _htmlDataExporter = new HtmlDataExporter(); } protected override string FileExtension => "html"; public void Dispose() { // Clean up the test file. if (File.Exists(FilePath)) { File.Delete(FilePath); } } [Fact] public void Export() { _htmlDataExporter.Export(SampleData, FileName); File.Exists(FilePath).Should().BeTrue(); string[]? rows = File.ReadAllLines(FilePath); void Check(int rowIdx, string expected) { rows[rowIdx].Trim().Should().Be(expected); } Check(0, "
| Name | Age |
|---|---|
| John | 30 |
| Jane | 25 |