public void QueryHandler_ImplementsIRequestHandler() { var mockPreviewService = new Mock <ICalculationPreviewService>(); var queryHandler = new PreviewCalculatorCalculateHandler(mockPreviewService.Object); queryHandler.ShouldBeAssignableTo <IRequestHandler <Query, Response> >(); }
public void QueryHandler_ShouldReturnResponse() { var query = new Query() { Person = new Person() }; var mockPreviewService = new Mock <ICalculationPreviewService>(); mockPreviewService.Setup(c => c.RunCalculation(It.IsAny <Person>())).Returns(query.Person); var queryHandler = new PreviewCalculatorCalculateHandler(mockPreviewService.Object); var response = queryHandler.Handle(query, new CancellationToken()); //TODO Add more tests here response.Result.ShouldBeAssignableTo <Response>(); }
public void QueryHandler_Exists() { var mockPreviewService = new Mock <ICalculationPreviewService>(); var queryHandler = new PreviewCalculatorCalculateHandler(mockPreviewService.Object); }