예제 #1
0
        public void LoLReturnsBadRequestIfCountIsNotSpecified()
        {
            // arrange
            var httpRequest = Substitute.For <HttpRequest>();

            httpRequest.Query["count"].Returns(StringValues.Empty);

            // act
            var result = LoL.GetLoLz(httpRequest, NullLogger.Instance);

            // assert
            result.ShouldBeOfType <BadRequestObjectResult>();
            (result as BadRequestObjectResult)?.Value.ShouldBe("Please pass a count on the query string");
        }
예제 #2
0
        public void LoLReturnsNumberOfLoLsRequested()
        {
            // arrange
            var httpRequest = Substitute.For <HttpRequest>();

            httpRequest.Query["count"].Returns(info => new StringValues("2"));

            // act
            var result = LoL.GetLoLz(httpRequest, NullLogger.Instance);

            // assert
            result.ShouldBeOfType <OkObjectResult>();
            (result as OkObjectResult)?.Value.ShouldBe("LoL.LoL.");
        }