public DayBatchDto MapToDayBatchDto(DayBatchModel dayBatchModel) { return(new DayBatchDto { DayBatchDate = dayBatchModel.DayBatchDate, CaseIds = dayBatchModel.CaseIds }); }
public void Given_An_DayBatchModel_When_I_Call_MapToDayBatchDto_Then_A_DayBatchDto_Is_Returned() { //arrange var dayBatchModel = new DayBatchModel(DateTime.Today, new List <string>()); //act var result = _sut.MapToDayBatchDto(dayBatchModel); //assert Assert.IsNotNull(result); Assert.IsInstanceOf <DayBatchDto>(result); }
public void Given_An_DayBatchModel_When_I_Call_MapToDayBatchDto_Then_An_ExpectedDayBatchDto_Is_Returned() { //arrange var dayBatchDate = DateTime.Today; var caseIds = new List <string> { "90001", "90002" }; var dayBatchModel = new DayBatchModel(dayBatchDate, caseIds); //act var result = _sut.MapToDayBatchDto(dayBatchModel); //assert Assert.IsNotNull(result); Assert.IsInstanceOf <DayBatchDto>(result); Assert.AreEqual(dayBatchDate, result.DayBatchDate); Assert.AreEqual(caseIds, result.CaseIds); }
public void Given_A_DayBatch_Does_Not_Exist_Today_When_I_Call_InstrumentHasADayBatchForToday_Then_False_Is_Returned() { //arrange const string instrumentName = "OPN2101A"; const string serverParkName = "ServerParkA"; var dayBatchModel = new DayBatchModel { DayBatchDate = DateTime.Today.AddDays(-1) }; _blaiseCatiApiMock.Setup(b => b.GetDayBatch(instrumentName, serverParkName)).Returns(dayBatchModel); //act var result = _sut.InstrumentHasADayBatchForToday(instrumentName, serverParkName); //assert Assert.IsNotNull(result); Assert.IsFalse(result); }