public void MapResponseToRequest()
        {
            var mapper = new ApiBusinessEntityAddressModelMapper();
            var model  = new ApiBusinessEntityAddressResponseModel();

            model.SetProperties(1, 1, 1, DateTime.Parse("1/1/1987 12:00:00 AM"), Guid.Parse("8420cdcf-d595-ef65-66e7-dff9f98764da"));
            ApiBusinessEntityAddressRequestModel response = mapper.MapResponseToRequest(model);

            response.AddressID.Should().Be(1);
            response.AddressTypeID.Should().Be(1);
            response.ModifiedDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM"));
            response.Rowguid.Should().Be(Guid.Parse("8420cdcf-d595-ef65-66e7-dff9f98764da"));
        }
Example #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());

            ApiBusinessEntityAddressResponseModel model = await client.BusinessEntityAddressGetAsync(1);

            ApiBusinessEntityAddressModelMapper mapper = new ApiBusinessEntityAddressModelMapper();

            UpdateResponse <ApiBusinessEntityAddressResponseModel> updateResponse = await client.BusinessEntityAddressUpdateAsync(model.BusinessEntityID, mapper.MapResponseToRequest(model));

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

            ApiBusinessEntityAddressModelMapper mapper = new ApiBusinessEntityAddressModelMapper();

            UpdateResponse <ApiBusinessEntityAddressResponseModel> updateResponse = await this.Client.BusinessEntityAddressUpdateAsync(model.BusinessEntityID, mapper.MapResponseToRequest(model));

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

            await this.Cleanup();
        }