public void TestGet() { // Arrange PrepareStorage(); IPartyInvitesR vRepository = new PartyInvitesR(); GuestResponse vNewRec = MakeNewRecord(); vRepository.Add(vNewRec); // Act GuestResponse vResult = vRepository.Get(vNewRec.Id); // Assert vResult.Id.Should().Be(vNewRec.Id); vResult.Email.Should().Be(vNewRec.Email); vResult.Name.Should().Be(vNewRec.Name); vResult.Phone.Should().Be(vNewRec.Phone); vResult.WillAttend.Should().Be(vNewRec.WillAttend); }
public void TestUpdate() { // Arrange const bool EXPECTED = false; PrepareStorage(); IPartyInvitesR vRepository = new PartyInvitesR(); vRepository.DeleteAll(); GuestResponse vNewRec = MakeNewRecord(true); vRepository.Add(vNewRec); GuestResponse vUpdatedRec = new GuestResponse(); vUpdatedRec.AssignFrom(vNewRec); vUpdatedRec.WillAttend = EXPECTED; // Act vRepository.Update(vUpdatedRec); GuestResponse vResult = vRepository.Get(vUpdatedRec.Id); // Assert vResult.WillAttend.Should().Be(EXPECTED); }