public void IndexSmokeTest_NotError() { // arrange var res = new IndexSmokeQuery { CountSigar = 10, AgeSmoke = 10 }; // act var handler = new IndexSmokeHandler(); var result = handler.Handle(res).Result; // assert Assert.AreEqual(5, result.Index); }
public void IndexSmokeTest_MoreError() { // arrange var modelMore = new IndexSmokeQuery { CountSigar = 1000, AgeSmoke = 151 }; // act var handler = new IndexSmokeHandler(); var errorModel = handler.Handle(modelMore).Exception.GetErrorListResponseFromException(); // assert Assert.IsTrue(errorModel != null); Assert.IsTrue(errorModel.Errors.Count == 2); Assert.IsTrue(errorModel.Errors.Contains(IndexSmokeQueryValidator.AgeSmokeIncorrectMessage)); Assert.IsTrue(errorModel.Errors.Contains(IndexSmokeQueryValidator.CountSigarIncorrectMessage)); }
public async Task <IndexSmokeResponse> CalculateIndexSmoke(IndexSmokeQuery query) { return(await _indexSmokeHandler.Handle(query)); }