public async void Get_null_record() { var mock = new ServiceMockFacade <ILessonRepository>(); mock.RepositoryMock.Setup(x => x.Get(It.IsAny <int>())).Returns(Task.FromResult <Lesson>(null)); var service = new LessonService(mock.LoggerMock.Object, mock.RepositoryMock.Object, mock.ModelValidatorMockFactory.LessonModelValidatorMock.Object, mock.BOLMapperMockFactory.BOLLessonMapperMock, mock.DALMapperMockFactory.DALLessonMapperMock, mock.BOLMapperMockFactory.BOLLessonXStudentMapperMock, mock.DALMapperMockFactory.DALLessonXStudentMapperMock, mock.BOLMapperMockFactory.BOLLessonXTeacherMapperMock, mock.DALMapperMockFactory.DALLessonXTeacherMapperMock); ApiLessonResponseModel response = await service.Get(default(int)); response.Should().BeNull(); mock.RepositoryMock.Verify(x => x.Get(It.IsAny <int>())); }
public async void TestGet() { ApiLessonResponseModel response = await this.Client.LessonGetAsync(1); response.Should().NotBeNull(); }