Add project files.

This commit is contained in:
2025-08-18 17:11:43 +03:30
parent 807dc263be
commit e5eb10d604
3943 changed files with 223719 additions and 0 deletions
@@ -0,0 +1,5 @@
<Project Sdk="Microsoft.NET.Sdk">
<ItemGroup>
<ProjectReference Include="..\..\..\src\modules\Elsa.Common\Elsa.Common.csproj" />
</ItemGroup>
</Project>
@@ -0,0 +1,29 @@
using Elsa.Extensions;
using Xunit;
namespace Elsa.Common.Core;
public class EnumerableExtensionsTests
{
[Fact]
public void ToBatches_ReturnsItemsInListOfPages()
{
var items = new List<int>
{
1,
2,
3,
4,
5
};
var batchSize = 2;
var batches = items.ToBatches(batchSize).ToList();
Assert.Equal(3, batches.Count);
Assert.Equal(2, batches.ElementAt(0).Count());
Assert.Equal(2, batches.ElementAt(1).Count());
Assert.Equal(1, batches.ElementAt(2).Count());
Assert.Equal(3, batches.ElementAt(1).ElementAt(0));
Assert.Equal(4, batches.ElementAt(1).ElementAt(1));
}
}