예제 #1
0
        public void SearchOrganisations_WithValidParams_ShouldCallTheApiWithTheCorrectUrl()
        {
            var fixtures = new ReferenceDataApiClientTestFixtures()
                           .WithBaseUrl(@"http://some-url/api/organisations/")
                           .WithSearchOrganisationsResult(searchTerm, maximumResults, new Organisation());

            fixtures.GetOrganisationSearch(searchTerm, maximumResults);

            fixtures.ChackUrlCalled(fixtures.BuildSearchOrganisationUrl(searchTerm, maximumResults));
        }
예제 #2
0
        public void SearchOrganisations_WithTrickyParams_ShouldEncodeParamsCorrectly()
        {
            var fixtures = new ReferenceDataApiClientTestFixtures()
                           .WithBaseUrl(@"http://some-url/api/organisations/")
                           .WithSearchOrganisationsResult(complexSearchTerm, maximumResults, new Organisation());

            fixtures.GetOrganisationSearch(complexSearchTerm, maximumResults);

            fixtures.ChackUrlCalled(fixtures.BuildSearchOrganisationUrl(complexSearchTerm, maximumResults));
        }