Esempio n. 1
0
        public async void Get_null_record()
        {
            var mock = new ServiceMockFacade <IBadgesRepository>();

            mock.RepositoryMock.Setup(x => x.Get(It.IsAny <int>())).Returns(Task.FromResult <Badges>(null));
            var service = new BadgesService(mock.LoggerMock.Object,
                                            mock.RepositoryMock.Object,
                                            mock.ModelValidatorMockFactory.BadgesModelValidatorMock.Object,
                                            mock.BOLMapperMockFactory.BOLBadgesMapperMock,
                                            mock.DALMapperMockFactory.DALBadgesMapperMock);

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

            response.Should().BeNull();
            mock.RepositoryMock.Verify(x => x.Get(It.IsAny <int>()));
        }
        public async void TestGet()
        {
            ApiBadgesResponseModel response = await this.Client.BadgesGetAsync(1);

            response.Should().NotBeNull();
        }