public async Task <BeginDecision.Response> GetDecision(BeginDecision.Request request) { var response = new BeginDecision.Response { Message = "Word to the wise... don't eat yellow snow!!!", NoticeType = "Advice", UserId = Guid.NewGuid().ToString(), AccountId = 421, DecisionMade = "Approved" }; return(await Task.Run(() => response)); }
public void ShouldBeDeepCompare() { var response = new BeginDecision.Response { Message = "Message from response", NoticeType = "ACCEPTED", UserId = "06e4e0c9-f244-4526-b3fb-01301b9cc4bb", AccountId = 321, DecisionMade = "Declined" }; var decision = BeginDecisionMock.WithHost(host); decision.WithDecision("Decision"); decision.WithDecisionId(123); decision.StartServer(); decision.ExpectedResponse.Should().BeEquivalentTo(response); decision.StopServer(); }
public BeginDecisionMock StartServer() { Server = FluentMockServer.Start(new FluentMockServerSettings { Urls = new[] { this._host }, StartAdminInterface = true }); Server.Reset(); ExpectedResponse = new BeginDecision.Response { Message = "Message from response", NoticeType = "ACCEPTED", UserId = "06e4e0c9-f244-4526-b3fb-01301b9cc4bb", AccountId = 321, DecisionMade = "Declined" }; Server.Given(Request.Create().UsingPost().WithPath(this._getUrl()).WithBody(new JsonMatcher( new { DecisionId = _decisionId, Decision = _decision }))).RespondWith(Response.Create().WithBodyAsJson(ExpectedResponse)); return(this); }