public async void Get_null_record()
        {
            var mock = new ServiceMockFacade <ILessonXStudentRepository>();

            mock.RepositoryMock.Setup(x => x.Get(It.IsAny <int>())).Returns(Task.FromResult <LessonXStudent>(null));
            var service = new LessonXStudentService(mock.LoggerMock.Object,
                                                    mock.RepositoryMock.Object,
                                                    mock.ModelValidatorMockFactory.LessonXStudentModelValidatorMock.Object,
                                                    mock.BOLMapperMockFactory.BOLLessonXStudentMapperMock,
                                                    mock.DALMapperMockFactory.DALLessonXStudentMapperMock);

            ApiLessonXStudentResponseModel response = await service.Get(default(int));

            response.Should().BeNull();
            mock.RepositoryMock.Verify(x => x.Get(It.IsAny <int>()));
        }
Пример #2
0
        public async void TestGet()
        {
            ApiLessonXStudentResponseModel response = await this.Client.LessonXStudentGetAsync(1);

            response.Should().NotBeNull();
        }