public void ShouldAddBillInfo() { Invitation invitation = new Invitation(); BillInfo billInfo = new BillInfo(10, DateTime.Now.Date, DateTime.Now.Date.AddDays(1), "101000010010"); invitation.AddBillInfo(billInfo); Assert.Equal(billInfo.AmountDue, invitation.BillInfo.AmountDue); Assert.Equal(billInfo.ExpiryDate, invitation.BillInfo.ExpiryDate); Assert.Equal(ObjectState.Added, invitation.BillInfo.State); Assert.Equal(ObjectState.Modified, invitation.State); }
public void ShouldDeleteBillInfoWhenSupplierWithdrawFromInvitation(int invitationStatusId, string rejectionReason) { Invitation invitation = new Invitation(); BillInfo billInfo = new BillInfo(10, DateTime.Now.Date, DateTime.Now.Date.AddDays(1), "101000010010"); invitation.AddBillInfo(billInfo); invitation.UpdateStatus(invitationStatusId, rejectionReason); Assert.Equal((int)Enums.InvitationStatus.Withdrawal, invitation.StatusId); Assert.Equal(DateTime.Now.Date, invitation.WithdrawalDate); Assert.All(invitation.BillInfo.BillPaymentDetails, p => Assert.Equal(ObjectState.Deleted, p.State)); Assert.Equal(ObjectState.Deleted, invitation.BillInfo.State); Assert.Equal(ObjectState.Modified, invitation.State); }