public async Task DeleteByIdAsync_UnknownEntity_ShouldThrowException()
        {
            // Arrange
            TestEntity[] entities = _fixture.CreateMany <TestEntity>(2).ToArray();

            var dbContextMock = new DbContextMock <TestDbContext>(_options);

            dbContextMock.CreateDbSetMock(x => x.TestEntities, (x, _) => x.Id, entities);
            var repository = new ReadWriteBaseRepository <TestEntity, Guid, TestDbContext>(dbContextMock.Object);

            // Act
            Func <Task> deleteEntity = async() => await repository.DeleteById(Guid.NewGuid());

            // Assert
            FluentAssertions.Specialized.ExceptionAssertions <NullReferenceException> result = await deleteEntity.Should().ThrowAsync <NullReferenceException>();
        }
        public async Task DeleteByIdAsync_KnownEntity_ShouldDeleteEntity()
        {
            // Arrange
            TestEntity[] entities = _fixture.CreateMany <TestEntity>(2).ToArray();

            var dbContextMock = new DbContextMock <TestDbContext>(_options);

            dbContextMock.CreateDbSetMock(x => x.TestEntities, (x, _) => x.Id, entities);
            var repository = new ReadWriteBaseRepository <TestEntity, Guid, TestDbContext>(dbContextMock.Object);

            // Act
            await repository.DeleteById(entities[0].Id);

            await repository.CommitAsync();

            TestEntity[] getAll = await repository.GetAll();

            // Assert
            getAll.SingleOrDefault(x => x.Id == entities[0].Id).Should().BeNull();
            getAll.Should().HaveCount(1);
        }