From 95aec861376e704e0af6ce89fe19eed54cdda09f Mon Sep 17 00:00:00 2001 From: sveinungf Date: Sat, 4 Nov 2023 21:19:42 +0100 Subject: [PATCH] Tests for many notes --- .../Tests/SpreadsheetNoteTests.cs | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/SpreadCheetah.Test/Tests/SpreadsheetNoteTests.cs b/SpreadCheetah.Test/Tests/SpreadsheetNoteTests.cs index b0443046..ad04c50d 100644 --- a/SpreadCheetah.Test/Tests/SpreadsheetNoteTests.cs +++ b/SpreadCheetah.Test/Tests/SpreadsheetNoteTests.cs @@ -217,15 +217,17 @@ public async Task Spreadsheet_AddNote_SheetXmlHasLegacyDrawing() Assert.Equal("rId1", legacyDrawing.Id); } - [Fact] - public async Task Spreadsheet_AddNote_MultipleNotesInWorksheet() + [Theory] + [InlineData(3)] + [InlineData(100)] + [InlineData(10000)] + public async Task Spreadsheet_AddNote_MultipleNotesInWorksheet(int count) { // Arrange - const int noteCount = 3; using var stream = new MemoryStream(); await using var spreadsheet = await Spreadsheet.CreateNewAsync(stream); await spreadsheet.StartWorksheetAsync("Sheet"); - var notes = Enumerable.Range(1, noteCount) + var notes = Enumerable.Range(1, count) .Select(x => SpreadsheetUtility.GetColumnName(x) + x) .Select(x => (Reference: x, NoteText: "Note for " + x)) .ToList(); @@ -297,14 +299,16 @@ public async Task Spreadsheet_AddNote_ExpectedNoteFileNames(bool noteInSecondShe Assert.DoesNotContain($"xl/worksheets/_rels/sheet{(noteInSecondSheet ? 1 : 2)}.xml.rels", filenames); } - [Fact] - public async Task Spreadsheet_AddNote_NotesInMultipleWorksheets() + [Theory] + [InlineData(3)] + [InlineData(10)] + [InlineData(1000)] + public async Task Spreadsheet_AddNote_NotesInMultipleWorksheets(int count) { // Arrange - const int noteCount = 3; using var stream = new MemoryStream(); await using var spreadsheet = await Spreadsheet.CreateNewAsync(stream); - var notes = Enumerable.Range(1, noteCount) + var notes = Enumerable.Range(1, count) .Select(x => SpreadsheetUtility.GetColumnName(x) + x) .Select(x => (Reference: x, NoteText: "Note for " + x)) .ToList();