Exemple #1
0
        public async void Get_null_record()
        {
            var mock = new ServiceMockFacade <IArtifactRepository>();

            mock.RepositoryMock.Setup(x => x.Get(It.IsAny <string>())).Returns(Task.FromResult <Artifact>(null));
            var service = new ArtifactService(mock.LoggerMock.Object,
                                              mock.RepositoryMock.Object,
                                              mock.ModelValidatorMockFactory.ArtifactModelValidatorMock.Object,
                                              mock.BOLMapperMockFactory.BOLArtifactMapperMock,
                                              mock.DALMapperMockFactory.DALArtifactMapperMock);

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

            response.Should().BeNull();
            mock.RepositoryMock.Verify(x => x.Get(It.IsAny <string>()));
        }
Exemple #2
0
        public async void TestGet()
        {
            ApiArtifactResponseModel response = await this.Client.ArtifactGetAsync("A");

            response.Should().NotBeNull();
        }