Skip to content

Commit

Permalink
Tests for many notes
Browse files Browse the repository at this point in the history
  • Loading branch information
sveinungf committed Nov 4, 2023
1 parent 5adb655 commit 95aec86
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions SpreadCheetah.Test/Tests/SpreadsheetNoteTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit 95aec86

Please sign in to comment.