コード例 #1
0
        public async void Get_null_record()
        {
            var mock = new ServiceMockFacade <ISaleTicketsRepository>();

            mock.RepositoryMock.Setup(x => x.Get(It.IsAny <int>())).Returns(Task.FromResult <SaleTickets>(null));
            var service = new SaleTicketsService(mock.LoggerMock.Object,
                                                 mock.RepositoryMock.Object,
                                                 mock.ModelValidatorMockFactory.SaleTicketsModelValidatorMock.Object,
                                                 mock.BOLMapperMockFactory.BOLSaleTicketsMapperMock,
                                                 mock.DALMapperMockFactory.DALSaleTicketsMapperMock);

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

            response.Should().BeNull();
            mock.RepositoryMock.Verify(x => x.Get(It.IsAny <int>()));
        }
コード例 #2
0
        public async void TestGet()
        {
            ApiSaleTicketsResponseModel response = await this.Client.SaleTicketsGetAsync(1);

            response.Should().NotBeNull();
        }