public void Limit2000TrueNewEntryTest() { var entry = new FinancialConsultantNewCustomerEntry { Name = "이희선", Gender = "0", Mobile = "01074000328", BirthDay = "19910328" }; IList <FinancialConsultantNewCustomerEntry> test = new List <FinancialConsultantNewCustomerEntry>(); for (var i = 0; i < 2000; i++) { test.Add(entry); } mockNewRepository.Setup(x => x.GetAll()).Returns(test.AsQueryable()); var result = service.limitNewCustomer(); //2000명일때 True Assert.NotNull(result); Assert.True(result); test.Add(entry); mockNewRepository.Setup(x => x.GetAll()).Returns(test.AsQueryable()); result = service.limitNewCustomer(); //2001명일때 False Assert.NotNull(result); Assert.False(result); }
public void updateNewEntry(FinancialConsultantNewCustomerEntry financialConsultantNewEntry) { var selectEntry = fcCustomerNewRepository.SingleOrDefault(x => x.Id.Equals(financialConsultantNewEntry.Id)); if (selectEntry != null) { fcCustomerNewRepository.Update(financialConsultantNewEntry); fcCustomerNewRepository.Save(); } fcCustomerNewRepository.Update(financialConsultantNewEntry); fcCustomerNewRepository.Save(); }
/// ################################################################################################################## #region saveNewEntry public FinancialConsultantNewCustomerEntry saveNewEntry(FinancialConsultantNewCustomerEntry financialConsultantNewEntry) { var selectEntry = fcCustomerNewRepository.SingleOrDefault(x => x.Mobile.Equals(financialConsultantNewEntry.Mobile)); if (selectEntry != null) { throw new EventServiceException("400", "이미 참여하셨습니다.", financialConsultantNewEntry); } var result = fcCustomerNewRepository.Add(financialConsultantNewEntry); fcCustomerNewRepository.Save(); return(result); }
public FinancialConsultantOriginalCustomerEntry existOriginCustomer(FinancialConsultantNewCustomerEntry financialConsultantNewCustomerEntry) { return(fcCustomerOriginRepository.SingleOrDefault(x => x.Mobile.Equals(financialConsultantNewCustomerEntry.Mobile))); }