public void Add_ShouldAssignANewId() { IListItemsRepository repo = GetInMemoryListItemRepository(); var addedItem = repo.Add(new ListItem { Title = "Test Add", Description = "Testing adding an item", Importance = "High", Type = "Special", Created = DateTime.Now, Updated = DateTime.Now, Due = DateTime.Now, }); Assert.NotNull(addedItem.Id); }
public void Add_ShouldIncrementTheNumberOfItemsByOne() { IListItemsRepository repo = GetInMemoryListItemRepository(); var startingCount = repo.Get().Count(); repo.Add(new ListItem { Title = "Test Add", Description = "Testing adding an item", Importance = "High", Type = "Special", Created = DateTime.Now, Updated = DateTime.Now, Due = DateTime.Now, }); var endingCount = repo.Get().Count(); Assert.NotEqual(startingCount, endingCount); Assert.True(endingCount == (startingCount + 1)); }