diff --git a/UnitTest/ItemTypesServiceTests.cs b/UnitTest/ItemTypesServiceTests.cs index 285bdf9..50e5110 100644 --- a/UnitTest/ItemTypesServiceTests.cs +++ b/UnitTest/ItemTypesServiceTests.cs @@ -67,6 +67,21 @@ public async Task TestGetAllItemTypes() Assert.AreEqual(2, result.Count); } + [TestMethod] + public async Task TestGetAllMax() + { + for (int i = 0; i < 300; i++) + { + ItemType randomType = TestHelper.CreateRandomItemType(); + await _dbContext.ItemTypes.AddAsync(randomType); + } + await _dbContext.SaveChangesAsync(); + + var result = await _baseStorageService.GetAllRows(1, 100); + Assert.AreEqual(100, result.Count); + Assert.IsTrue(result.All(type => type.Id <= 100)); + } + [TestMethod] public async Task TestPostItemTypes() { diff --git a/UnitTest/TestHelper.cs b/UnitTest/TestHelper.cs index ef01d53..b557a8f 100644 --- a/UnitTest/TestHelper.cs +++ b/UnitTest/TestHelper.cs @@ -227,4 +227,13 @@ public static ItemLine CreateRandomItemLine() Name = "Test Line", Description = "Line Description" }; + + public static ItemType CreateRandomItemType() + { + return new ItemType + { + Name = Guid.NewGuid().ToString(), + Description = Guid.NewGuid().ToString() + }; + } } \ No newline at end of file