// test exception if attempt to save in invalid state private async Task <PaymentER> BuildValidPaymentER() { var paymentER = await PaymentER.NewPaymentER(); paymentER.Amount = 39.99; paymentER.Person = await PersonEC.GetPersonEC(new Person() { Id = 1 }); paymentER.LastUpdatedBy = "edm"; paymentER.LastUpdatedDate = DateTime.Now; paymentER.Notes = "notes here"; paymentER.PaymentDate = DateTime.Now; paymentER.PaymentExpirationDate = DateTime.Now; paymentER.PaymentSource = await PaymentSourceEC.GetPaymentSourceEC(new PaymentSource() { Id = 1 }); paymentER.PaymentType = await PaymentTypeEC.GetPaymentTypeEC(new PaymentType() { Id = 1 }); return(paymentER); }
public async Task TestPersonEC_Get() { var person = await PersonEC.GetPersonEC(BuildPerson()); Assert.NotNull(person); Assert.IsType <PersonEC>(person); Assert.Equal(999, person.Id); Assert.True(person.IsValid); }
private async Task BuildPersonalNote(PersonalNoteEC personalNote) { personalNote.Person = await PersonEC.GetPersonEC(new Person() { Id = 1 }); personalNote.Description = "personal note description"; personalNote.StartDate = DateTime.Now; personalNote.DateEnd = DateTime.Now.AddMonths(12); personalNote.LastUpdatedBy = "Hank"; personalNote.LastUpdatedDate = DateTime.Now; personalNote.Note = "notes for personal note"; }
private async Task BuildTermInOffice(TermInOfficeEC termObj) { termObj.Office = await OfficeEC.GetOfficeEC(new Office() { Id = 1 }); termObj.Person = await PersonEC.GetPersonEC(new Person() { Id = 1 }); termObj.StartDate = DateTime.Now; termObj.LastUpdatedBy = "edm"; termObj.LastUpdatedDate = DateTime.Now; termObj.Notes = "notes for doctype"; }
public async Task ContactForSponsorER_TestUpdatePersonId() { const int CONTACT_ID = 1; const int NEW_PERSON_ID = 2; var contactForSponsor = await ContactForSponsorER.GetContactForSponsorER(1); var newPerson = MockDb.Persons.First(p => p.Id == NEW_PERSON_ID); contactForSponsor.Person = await PersonEC.GetPersonEC(newPerson); var result = await contactForSponsor.SaveAsync(); var fetchResult = await ContactForSponsorER.GetContactForSponsorER(CONTACT_ID); Assert.NotNull(fetchResult); Assert.Equal(2, fetchResult.Person.Id); }
private async Task BuildContactForSponsor(ContactForSponsorEC contactForSponsor) { var sponsor = MockDb.Sponsors.First(); var person = MockDb.Persons.First(); contactForSponsor.Sponsor = await SponsorEC.GetSponsorEC(sponsor); contactForSponsor.Person = await PersonEC.GetPersonEC(person); contactForSponsor.DateWhenContacted = DateTime.Now; contactForSponsor.Purpose = "purpose for contact"; contactForSponsor.RecordOfDiscussion = "this was discussed"; contactForSponsor.Notes = "notes for contact"; contactForSponsor.LastUpdatedBy = "edm"; contactForSponsor.LastUpdatedDate = DateTime.Now; contactForSponsor.Notes = "notes for doctype"; }
private async Task BuildMemberInfoEC(MemberInfoEC memberInfo) { var domainInfo = BuildMemberInfo(); memberInfo.Notes = domainInfo.Notes; memberInfo.Person = await PersonEC.GetPersonEC(domainInfo.Person); memberInfo.MemberNumber = domainInfo.MemberNumber; memberInfo.MembershipType = await MembershipTypeEC.GetMembershipTypeEC(domainInfo.MembershipType); memberInfo.MemberStatus = await MemberStatusEC.GetMemberStatusEC(domainInfo.MemberStatus); memberInfo.PrivacyLevel = await PrivacyLevelEC.GetPrivacyLevelEC(domainInfo.PrivacyLevel); memberInfo.DateFirstJoined = new SmartDate(DateTime.Now); memberInfo.LastUpdatedBy = domainInfo.LastUpdatedBy; memberInfo.LastUpdatedDate = domainInfo.LastUpdatedDate; }
private async Task BuildValidPaymentEC(PaymentEC payment) { payment.Amount = 39.99; payment.Person = await PersonEC.GetPersonEC(new Person() { Id = 1 }); payment.LastUpdatedBy = "edm"; payment.LastUpdatedDate = DateTime.Now; payment.Notes = "notes here"; payment.PaymentDate = DateTime.Now; payment.PaymentExpirationDate = DateTime.Now; payment.PaymentSource = await PaymentSourceEC.GetPaymentSourceEC(new PaymentSource() { Id = 1 }); payment.PaymentType = await PaymentTypeEC.GetPaymentTypeEC(new PaymentType() { Id = 1 }); }
private async Task <PersonEC> BuildPersonEC() { var person = MockDb.Persons.First(); return(await PersonEC.GetPersonEC(person)); }