public void DELETE_ID_EXPECT_TYPEDATAEXCEPTION() { //GET THE FIRST CUSTOMER IN MOCKDB ReviewDto dto = MockReviewDataAdapter.CreateDtoFromData(MockDb.Reviews[0]); //ADAPTER.DELETE _Adapter.Delete(dto.Id); //ATTEMPT GET ON DELETED CUSTOMER ID, SHOULD THROW CUSTOMERDATAEXCEPTION _Adapter.Get(dto.Id); }
public void UPDATE_DTO() { //GET THE FIRST CUSTOMER IN MOCKDB var dto = MockReviewDataAdapter.CreateDtoFromData(MockDb.Reviews[0]); //SET NEW PROPERTIES int newRating = 2; string newComments = "These are my NEW NEW NEW COMMENTS"; dto.Rating = newRating; dto.Comments = newComments; dto.CustomerId = MockDb.CustId1;//hack:WcfService.Tests test update_dto //ADAPTER.UPDATE _Adapter.Update(dto); //ASSERT THAT UPDATE OCCURRED var checkDto = _Adapter.Get(dto.Id); Assert.AreEqual(dto.Rating, checkDto.Rating); Assert.AreEqual(dto.Comments, checkDto.Comments); Assert.AreEqual(dto.CustomerId, checkDto.CustomerId); }