Exemplo n.º 1
0
        public void Test_ShowStatisticsRequest_Returns_Valid_UriPathParameters()
        {
            var request = new ShowStatisticsRequest {
                Id = "123"
            };

            request.GetUriPathParameters().Should().NotBeNull()
            .And.HaveCount(1)
            .And.Contain(new Dictionary <string, object>
            {
                ["id"] = "123"
            });
        }
Exemplo n.º 2
0
        public void Test_ShowStatisticsRequest_Validate_Throws_Exceptions()
        {
            // id is null
            var request = new ShowStatisticsRequest();

            Action act = () => request.Validate();

            act.Should().Throw <ArgumentNullException>();

            // empty id
            request = new ShowStatisticsRequest {
                Id = string.Empty
            };

            act = () => request.Validate();
            act.Should().Throw <ArgumentException>();

            // id with spaces
            request = new ShowStatisticsRequest {
                Id = "invalid id"
            };
            act.Should().Throw <ArgumentException>();
        }
Exemplo n.º 3
0
        public void Test_ShowStatisticsRequest_Has_Valid_UriTemplate()
        {
            var request = new ShowStatisticsRequest();

            request.UriTemplate.Should().Be("shows/{id}/stats");
        }