public void GetDate_QuoteStatusGreaterNegative1() { _quoteResultRepository.GetStartDate(Arg.Any <long>()).Returns(x => new InsuranceStartDate() { BizStartDate = new System.DateTime(2018, 1, 1), ForceStartDate = new System.DateTime(2018, 2, 2) }); var postBizStartDate = ""; var result = _getDateService.GetDate(new bx_userinfo() { QuoteStatus = 1 }, out postBizStartDate); Assert.AreEqual("2018-02-02 00:00", result); Assert.AreEqual("2018-01-01 00:00", postBizStartDate); }
public string GetDate(bx_userinfo userinfo, out string postBizStartDate) { var quoteresult = userinfo.QuoteStatus > -1 ? _quoteResultRepository.GetStartDate(userinfo.Id) : new InsuranceStartDate(); //,userinfo.Source.Value string postForceStartDate = string.Empty; //交强险起始时间 postBizStartDate = string.Empty; //商业险起始时间 //报价成功取quoteresult表起保时间 if (userinfo.QuoteStatus > 0) { postForceStartDate = quoteresult != null ? (quoteresult.ForceStartDate.HasValue ? quoteresult.ForceStartDate.Value.ToString("yyyy-MM-dd HH:mm") : "") : ""; postBizStartDate = quoteresult != null ? (quoteresult.BizStartDate.HasValue ? quoteresult.BizStartDate.Value.ToString("yyyy-MM-dd HH:mm") : "") : ""; } return(postForceStartDate); }