Exemplo n.º 1
0
        public void GivenABaseApiService_WhenPathIsNull_ThenBuildRequestUrlThrowsException()
        {
            // Arrange
            var apiService = new StubApiService();

            // Act
            apiService.BuildRequestUrl(null);
        }
Exemplo n.º 2
0
        public void GivenABaseApiService_WhenQueryParamsIsNull_ThenBuildRequestUrlAppendsNoParams()
        {
            // Arrange
            var apiService = new StubApiService();

            // Act
            var url = apiService.BuildRequestUrl("test", null);

            // Assert
            url.QueryParams.ShouldBeEmpty();
        }
Exemplo n.º 3
0
        public void GivenABaseApiService_WhenPathHasValue_ThenItIsAppendedToUrl()
        {
            // Arrange
            var apiService = new StubApiService();

            // Act
            var url = apiService.BuildRequestUrl("test");

            // Assert
            url.Path.ShouldEqual("https://slack.com/api/test");
        }