static Program() { IRules <EnrollmentRecord> rules = new EnrollmentDateRules(); fileHandler = new CsvFileReader <EnrollmentRecord, EnrollmentRecordMap>(); recordHandler = new RecordProcessor <EnrollmentRecord, ProcessedEnrollmentRecord>(rules); recordHandler.RecordReceivedEvent += PublishToConsole; }
public void Do_DOB_Twenty_Years_Ago_And_EffectiveDate_One_Hundred_Years_Ago_Returns_True() { //Arrange var model = new EnrollmentRecord { DOB = DateTime.Now.AddYears(-20), EffectiveDate = DateTime.Now.AddYears(-100) }; var sut = new EnrollmentDateRules(); //Act var result = sut.Do(model); //Assert Assert.IsTrue(result); }
public void Do_DOB_Nineteen_Years_Ago_And_EffectiveDate_Now_Returns_True() { //Arrange var model = new EnrollmentRecord { DOB = DateTime.Now.AddYears(-19), EffectiveDate = DateTime.Now }; var sut = new EnrollmentDateRules(); //Act var result = sut.Do(model); //Assert Assert.IsTrue(result); }
public void Do_DOB_Eighteen_Years_In_The_Future_And_EffectiveDate_Now_Returns_False() { //Arrange var model = new EnrollmentRecord { DOB = DateTime.Now.AddYears(18), EffectiveDate = DateTime.Now }; var sut = new EnrollmentDateRules(); //Act var result = sut.Do(model); //Assert Assert.IsFalse(result); }
public void Do_DOB_Twenty_Years_Ago_And_EffectiveDate_Thirty_One_Days_In_Future_Returns_False() { //Arrange var model = new EnrollmentRecord { DOB = DateTime.Now.AddYears(-20), EffectiveDate = DateTime.Now.AddDays(31) }; var sut = new EnrollmentDateRules(); //Act var result = sut.Do(model); //Assert Assert.IsFalse(result); }