예제 #1
0
        public async Task GetAsyncById_ShouldReturnExerciseDto(int id)
        {
            var exercise = _fixture.Build <Exercise>()
                           .With(e => e.Id, id)
                           .Create();

            _exerciseRepository.GetAsync(id).Returns(exercise);

            var dto = await _sut.GetAsync(id);

            dto.ShouldNotBeNull();
            dto.Id.ShouldBe(exercise.Id);
            dto.ShouldBeOfType(typeof(ExerciseDto));
            await _exerciseRepository.Received(1).GetAsync(id);
        }