コード例 #1
0
        public async Task should_return_video_not_found_when_video_not_exist_for_a_name()
        {
            var name            = "peli1";
            var videoRepository = GivenAClsVideoRepositorySqlMock();

            SetVideoNotFoundReturnForVideoRepositoryMock(videoRepository, name);
            var action = new FindVideoAction(videoRepository);

            var actualVideo = await action.Execute(name);

            actualVideo.Should().BeOfType <VideoNotFound>().Which.name.Should().Be(name);
            await videoRepository.Received(1).Find(name);
        }
コード例 #2
0
        public async Task   should_return_a_video_for_a_name()
        {
            var name        = "peli1";
            var expectVideo = new Video {
                name = name, format = "avi"
            };
            var videoRepository = GivenAClsVideoRepositorySqlMock();

            SetVideoReturnForVideoRepositoryMock(videoRepository, name, expectVideo);
            var action = new FindVideoAction(videoRepository);

            var actualvideo = await action.Execute(name);

            actualvideo.Should().BeEquivalentTo(expectVideo);
            await videoRepository.Received(1).Find(name);
        }