public void MapResponseToRequest()
        {
            var mapper = new ApiPersonCreditCardModelMapper();
            var model  = new ApiPersonCreditCardResponseModel();

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

            response.CreditCardID.Should().Be(1);
            response.ModifiedDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM"));
        }
Beispiel #2
0
        public async void TestUpdate()
        {
            var model = await this.CreateRecord();

            ApiPersonCreditCardModelMapper mapper = new ApiPersonCreditCardModelMapper();

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

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

            await this.Cleanup();
        }
        public void CreatePatch()
        {
            var mapper = new ApiPersonCreditCardModelMapper();
            var model  = new ApiPersonCreditCardRequestModel();

            model.SetProperties(1, DateTime.Parse("1/1/1987 12:00:00 AM"));

            JsonPatchDocument <ApiPersonCreditCardRequestModel> patch = mapper.CreatePatch(model);
            var response = new ApiPersonCreditCardRequestModel();

            patch.ApplyTo(response);
            response.CreditCardID.Should().Be(1);
            response.ModifiedDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM"));
        }