public async void Get_null_record()
        {
            var mock = new ServiceMockFacade <ISalesOrderHeaderSalesReasonRepository>();

            mock.RepositoryMock.Setup(x => x.Get(It.IsAny <int>())).Returns(Task.FromResult <SalesOrderHeaderSalesReason>(null));
            var service = new SalesOrderHeaderSalesReasonService(mock.LoggerMock.Object,
                                                                 mock.RepositoryMock.Object,
                                                                 mock.ModelValidatorMockFactory.SalesOrderHeaderSalesReasonModelValidatorMock.Object,
                                                                 mock.BOLMapperMockFactory.BOLSalesOrderHeaderSalesReasonMapperMock,
                                                                 mock.DALMapperMockFactory.DALSalesOrderHeaderSalesReasonMapperMock);

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

            response.Should().BeNull();
            mock.RepositoryMock.Verify(x => x.Get(It.IsAny <int>()));
        }
Beispiel #2
0
        public async void TestGet()
        {
            ApiSalesOrderHeaderSalesReasonResponseModel response = await this.Client.SalesOrderHeaderSalesReasonGetAsync(1);

            response.Should().NotBeNull();
        }