unit tests

This commit is contained in:
Sean Garrett
2023-06-15 21:56:47 +01:00
parent 0cf6a7e5d3
commit 54e756c695
18 changed files with 817 additions and 8 deletions
@@ -0,0 +1,33 @@
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using CoreUnitTests.Infrastructure;
using CoreUnitTests.Infrastructure.Model;
using MongoDbGenericRepository.DataAccess.Create;
using Moq;
using Xunit;
namespace CoreUnitTests.BaseMongoRepositoryTests.AddTests;
public class AddManyTests : TestMongoRepositoryContext
{
[Fact]
public async Task AddManyAsync_EnsureTokenPassed()
{
// Arrange
Creator = new Mock<IMongoDbCreator>();
var token = new CancellationToken();
var documents = new List<TestDocument>
{
new(), new(), new()
};
// Act
await Sut.AddManyAsync(documents, token);
// Assert
Creator.Verify(x => x.AddManyAsync<TestDocument, Guid>(documents, token));
}
}