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

            mock.RepositoryMock.Setup(x => x.Get(It.IsAny <int>())).Returns(Task.FromResult <Comments>(null));
            var service = new CommentsService(mock.LoggerMock.Object,
                                              mock.RepositoryMock.Object,
                                              mock.ModelValidatorMockFactory.CommentsModelValidatorMock.Object,
                                              mock.BOLMapperMockFactory.BOLCommentsMapperMock,
                                              mock.DALMapperMockFactory.DALCommentsMapperMock);

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

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

            response.Should().NotBeNull();
        }