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

            mock.RepositoryMock.Setup(x => x.Get(It.IsAny <string>())).Returns(Task.FromResult <ProjectGroup>(null));
            var service = new ProjectGroupService(mock.LoggerMock.Object,
                                                  mock.RepositoryMock.Object,
                                                  mock.ModelValidatorMockFactory.ProjectGroupModelValidatorMock.Object,
                                                  mock.BOLMapperMockFactory.BOLProjectGroupMapperMock,
                                                  mock.DALMapperMockFactory.DALProjectGroupMapperMock);

            ApiProjectGroupResponseModel response = await service.Get(default(string));

            response.Should().BeNull();
            mock.RepositoryMock.Verify(x => x.Get(It.IsAny <string>()));
        }
        public async void TestGet()
        {
            ApiProjectGroupResponseModel response = await this.Client.ProjectGroupGetAsync("A");

            response.Should().NotBeNull();
        }