Exemplo n.º 1
0
        public async void Get_null_record()
        {
            var mock = new ServiceMockFacade <ILessonStatusRepository>();

            mock.RepositoryMock.Setup(x => x.Get(It.IsAny <int>())).Returns(Task.FromResult <LessonStatus>(null));
            var service = new LessonStatusService(mock.LoggerMock.Object,
                                                  mock.RepositoryMock.Object,
                                                  mock.ModelValidatorMockFactory.LessonStatusModelValidatorMock.Object,
                                                  mock.BOLMapperMockFactory.BOLLessonStatusMapperMock,
                                                  mock.DALMapperMockFactory.DALLessonStatusMapperMock,
                                                  mock.BOLMapperMockFactory.BOLLessonMapperMock,
                                                  mock.DALMapperMockFactory.DALLessonMapperMock);

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

            response.Should().BeNull();
            mock.RepositoryMock.Verify(x => x.Get(It.IsAny <int>()));
        }
Exemplo n.º 2
0
        public async void TestGet()
        {
            ApiLessonStatusResponseModel response = await this.Client.LessonStatusGetAsync(1);

            response.Should().NotBeNull();
        }