Пример #1
0
        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));
        }
Пример #2
0
        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();
        }
Пример #3
0
        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);
        }