Ejemplo n.º 1
0
        public async Task GetSubmissions_HasNoSubmissions_Produces200()
        {
            // Arrange
            var expectedStatusCode = (int)HttpStatusCode.OK;
            var request            = new GetSubmissions {
                Page = 1
            };
            var mediatorResponse = new GetSubmissionsResponse(request.Page, 1);

            _mediatorMock.Setup(x => x.Send(request, default)).ReturnsAsync(mediatorResponse);
            var controller = new CompetitionController(_mediatorMock.Object);

            // Act
            var response = await controller.GetSubmissions(request);

            var actualResponse = response as OkObjectResult;

            // Assert
            actualResponse.StatusCode.Should().Be(expectedStatusCode);
        }