public void DELETE_ID_EXPECT_TYPEDATAEXCEPTION() { //GET THE FIRST CUSTOMER IN MOCKDB CustomerDto dto = MockCustomerDataAdapter.CreateDtoFromData(MockDb.Customers[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 CustomerDto dto = MockCustomerDataAdapter.CreateDtoFromData(MockDb.Customers[0]); //SET NEW PROPERTIES var newName = "MyNewNameHere"; var newEmail = "*****@*****.**"; dto.Name = newName; dto.EmailAddress = newEmail; //ADAPTER.UPDATE _Adapter.Update(dto); //ASSERT THAT UPDATE OCCURRED var checkDto = _Adapter.Get(dto.Id); Assert.AreEqual(dto.Name, checkDto.Name); Assert.AreEqual(dto.EmailAddress, checkDto.EmailAddress); }