public async Task WhenUpdateAsyncIsCalledThenCategoryGroupIsUpdated() { List <CategoryGroup> categoriesToInsert = new List <CategoryGroup> { new CategoryGroup { Id = 1, Name = "Bills", UserId = "00000000-0000-0000-0000-000000000001" } }; this.databaseHelper.Insert(categoriesToInsert); var categoryGroup = new Models.CategoryGroup { Id = 1, Name = "Just For Fun", UserId = new Guid("00000000-0000-0000-0000-000000000001") }; await this.categoryGroupRepository.UpdateAsync(categoryGroup); List <CategoryGroup> updatedCategoryGroups = this.databaseHelper.Select <CategoryGroup>(c => c.Name == "Just For Fun"); Assert.That(updatedCategoryGroups.Count, Is.EqualTo(1)); }
public async Task WhenAddAsyncIsCalledThenCategoryGroupIsInserted() { var categoryGroup = new Models.CategoryGroup { Id = 1, Name = "Bills", UserId = new Guid("00000000-0000-0000-0000-000000000001") }; await this.categoryGroupRepository.AddAsync(categoryGroup); List <CategoryGroup> insertedCategoryGroups = this.databaseHelper.Select <CategoryGroup>(c => c.Name == "Bills"); Assert.That(insertedCategoryGroups.Count, Is.EqualTo(1)); }