public void Then_the_default_api_root_is_used()
                {
                    HsaApi api = null;

                    api = new HsaApi(ApiKey);

                    VerifyThatDefaultApiRootIsUsed(api);
                }
                public void Then_the_api_key_is_used()
                {
                    HsaApi api = null;

                    api = new HsaApi(ApiKey);

                    VerifyThatApiKeyIsUsed(api);
                }
                public void Then_the_default_rest_client_is_used()
                {
                    HsaApi api = null;

                    api = new HsaApi(ApiKey);

                    VerifyThatDefaultRestClientIsUsed(api);
                }
                public void Then_these_and_the_default_rest_client_are_used()
                {
                    HsaApi api = null;

                    api = new HsaApi(ApiKey, ApiRoot);

                    VerifyThatApiKeyIsUsed(api);
                    VerifyThatApiRootIsUsed(api);
                    VerifyThatDefaultRestClientIsUsed(api);
                }
 protected void VerifyThatApiRootIsUsed(HsaApi api)
 {
     api.ApiRoot.Should().BeSameAs(ApiRoot);
 }
 protected void VerifyThatDefaultApiRootIsUsed(HsaApi api)
 {
     api.ApiRoot.Should().Be(HsaApi.DefaultApiHost);
 }
 protected void VerifyThatDefaultRestClientIsUsed(HsaApi api)
 {
     api.RestClient.Should().BeSameAs(HsaApi.DefaultRestClient);
 }
 protected void VerifyThatApiKeyIsUsed(HsaApi api)
 {
     api.ApiKey.Should().BeSameAs(ApiKey);
 }
                public void Then_an_ArgumentNullException_is_thrown()
                {
                    // ReSharper disable once NotAccessedVariable
                    HsaApi api = null;

                    var action = (Action) (() => api = new HsaApi(ApiKey, null));

                    action.ShouldThrow<ArgumentNullException>().And.ParamName.Should().Be("apiRoot");
                }
Beispiel #10
0
                public void Then_these_and_the_default_api_root_are_used()
                {
                    HsaApi api = null;

                    api = new HsaApi(RestClient, ApiKey);

                    VerifyThatApiKeyIsUsed(api);
                    VerifyThatRestClientIsUsed(api);
                    VerifyThatDefaultApiRootIsUsed(api);
                }