Пример #1
0
        public async Task Create_BadRequest_response_when_snack_does_not_exist(
            Guid snackId,
            SnackController sut)
        {
            // Act
            var result = await sut.GetSnack(snackId);

            // Arrange
            result.Should().BeOfType <NotFoundObjectResult>();
        }
Пример #2
0
        public async Task Create_OkResult_with_snack_response_when_snack_does_exist(
            [Frozen] Mock <ISnackRepository> snackRepositoryMock,
            Guid snackId,
            Snack snack,
            SnackController sut)
        {
            // Arrange
            snackRepositoryMock.Setup(x => x.GetSnackAsync(snackId)).ReturnsAsync(snack);

            // Act
            var result = await sut.GetSnack(snackId);

            // Arrange
            result.Should().BeOfType <OkObjectResult>()
            .Which.Value.Should().BeOfType <GetSnackModel.Response>();
        }