public void GetReplacementsBadRequestTest()
        {
            _simulator.Get("/api/replacements").WithParameter("d", "").Responds("").WithCode(400);

            PhilterClient philterClient = new PhilterClient(GetClient());

            Assert.ThrowsException <ClientException>(() => philterClient.Filter("His SSN was 123-45-6789.", "context", "default"));
        }
 public void Setup()
 {
     _simulator = new FluentSimulator("http://localhost:8050/");
     _simulator.Get("/api/v2/users").Responds("{Success: true}");
     _simulator.Start();
     _apiGateway = new ApiGateway("http://localhost:8050/");
 }
Example #3
0
            public void SetUp()
            {
                _slackApi     = new FluentSimulator(Address);
                _slackGateway = new SlackGateway(Address, Token);

                var json = File.ReadAllText(
                    Path.Combine(
                        AppDomain.CurrentDomain.BaseDirectory,
                        "Gateway/ApiEndpointResponse/ExcludedSlackUsersResponse.json"
                        )
                    );

                _slackApi.Get("/api/users.list").Responds(json);

                _slackApi.Start();

                _response = _slackGateway.RetrieveBillablePeople();
            }
        private static void HandleSetUp()
        {
            _slackApi     = new FluentSimulator(SlackApiAddress);
            _slackGateway = new SlackGateway(SlackApiAddress, "xxxx-xxxxxxxxx-xxxx");
            _sendReminder = new SendReminder(_slackGateway);

            var slackGetUsersResponse = File.ReadAllText(
                Path.Combine(
                    AppDomain.CurrentDomain.BaseDirectory,
                    "../../../ApiEndpointResponse/SlackUsersResponse.json"
                    )
                );

            _slackApi.Get("/" + SlackApiUsersPath).Responds(slackGetUsersResponse);

            _slackApi.Post("/" + SlackApiPostMessagePath).Responds(new { ok = true });

            _slackApi.Start();
        }
Example #5
0
 public void SetUpAll(AirtableResponse expectedResponse, string TABLE_ID, string AIRTABLE_API_KEY) =>
 simulator.Get("/v0/" + TABLE_ID + "/Marketplace")
 .WithParameter("maxRecords", maxRecords)
 .WithParameter("api_key", AIRTABLE_API_KEY)
 .WithParameter("view", "Upcoming")
 .Responds(expectedResponse);