Esempio n. 1
0
        public async Task Given_CreateExam_When_ModelIsValid_Then_OkStatusCode()
        {
            // Arrange
            var examGuid = new Guid("ef7e98df-26ed-4b21-b874-c3a2815d18ac");
            var Id       = Task.FromResult(examGuid);

            mockRepo
            .Setup(e => e.CreateNew(createExamModel))
            .Returns(Id);

            // Act
            var Result = (OkObjectResult)await controller.CreateExam(createExamModel);

            // Assert
            Assert.IsType <OkObjectResult>(Result);
            Assert.Equal(Id.Result, Result.Value);
        }