public void SetUp() { testDataHelper = new TestDataHelper(); repository = new ConstituentNameRepository(testDataHelper.session); jamesFranklin = ConstituentNameMother.JamesFranklin(); savedConstituentName = testDataHelper.CreateConstituentName(jamesFranklin); }
public ConstituentName Update(ConstituentName constituentName) { using (var txn = session.BeginTransaction()) { var savedConstituentName = SaveOrUpdate(constituentName, txn); txn.Commit(); return savedConstituentName; } }
private void LoadSalutationType(ConstituentName name) { if (Entity.IsNull(name.Salutation)) { throw new BadRequestException("SalutationType can not be null"); } name.Salutation = repository.Load<SalutationType>(name.Salutation.Id); }
public ConstituentName UpdateConstituentName(string id, ConstituentName name) { LoadSalutationType(name); if (repository.Exists<ConstituentName>(Convert.ToInt32(id))) { return repository.Update(name); } return null; }
public static Constituent ConstituentWithName(ConstituentName constituentName, char registered = 'N') { var constituent = new Constituent { Gender = "F", BornOn = DateTime.Today, BranchName = BranchTypeMother.Anavalaril(), MaritialStatus = 1, IsRegistered = registered }; constituent.Name = constituentName; return constituent; }
public void SetUp() { jamesFranklin = ConstituentNameMother.JamesFranklin(); validator = new ConstituentNameValidator(); }