public
Created

  • Download Gist
gistfile1.cs
C#
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
[Test]
public void When_saving_a_new_document_document_is_persisted()
{
const int expectedCategoryCount = 2;
var repository = GetRepository();
 
repository.Save(new List<Category>
{
new Category
{
Id = Guid.NewGuid().ToString()
},
new Category
{
Id = Guid.NewGuid().ToString()
}
});
 
var result = repository.GetAll();
result.Count().Should().Be(expectedCategoryCount);
}
 
[TearDown]
public void TearDown()
{
var repository = GetRepository();
repository.GetAll().ForEach(x => repository.Delete(x.Id));
}

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.