public void MapResponseToRequest()
        {
            var mapper = new ApiTransactionHistoryArchiveModelMapper();
            var model  = new ApiTransactionHistoryArchiveResponseModel();

            model.SetProperties(1, 1m, DateTime.Parse("1/1/1987 12:00:00 AM"), 1, 1, 1, 1, DateTime.Parse("1/1/1987 12:00:00 AM"), "A");
            ApiTransactionHistoryArchiveRequestModel response = mapper.MapResponseToRequest(model);

            response.ActualCost.Should().Be(1m);
            response.ModifiedDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM"));
            response.ProductID.Should().Be(1);
            response.Quantity.Should().Be(1);
            response.ReferenceOrderID.Should().Be(1);
            response.ReferenceOrderLineID.Should().Be(1);
            response.TransactionDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM"));
            response.TransactionType.Should().Be("A");
        }
Пример #2
0
        public async void TestUpdate()
        {
            var builder = new WebHostBuilder()
                          .UseEnvironment("Production")
                          .UseStartup <TestStartup>();
            TestServer testServer = new TestServer(builder);

            var client = new ApiClient(testServer.CreateClient());

            ApiTransactionHistoryArchiveResponseModel model = await client.TransactionHistoryArchiveGetAsync(1);

            ApiTransactionHistoryArchiveModelMapper mapper = new ApiTransactionHistoryArchiveModelMapper();

            UpdateResponse <ApiTransactionHistoryArchiveResponseModel> updateResponse = await client.TransactionHistoryArchiveUpdateAsync(model.TransactionID, mapper.MapResponseToRequest(model));

            updateResponse.Record.Should().NotBeNull();
            updateResponse.Success.Should().BeTrue();
        }
Пример #3
0
        public async void TestUpdate()
        {
            var model = await this.CreateRecord();

            ApiTransactionHistoryArchiveModelMapper mapper = new ApiTransactionHistoryArchiveModelMapper();

            UpdateResponse <ApiTransactionHistoryArchiveResponseModel> updateResponse = await this.Client.TransactionHistoryArchiveUpdateAsync(model.TransactionID, mapper.MapResponseToRequest(model));

            updateResponse.Record.Should().NotBeNull();
            updateResponse.Success.Should().BeTrue();

            await this.Cleanup();
        }