Exemplo n.º 1
0
        private async Task <ApiPersonCreditCardResponseModel> CreateRecord()
        {
            var model = new ApiPersonCreditCardRequestModel();

            model.SetProperties(1, DateTime.Parse("1/1/1988 12:00:00 AM"));
            CreateResponse <ApiPersonCreditCardResponseModel> result = await this.Client.PersonCreditCardCreateAsync(model);

            result.Success.Should().BeTrue();
            return(result.Record);
        }
        public void MapModelToBO()
        {
            var mapper = new BOLPersonCreditCardMapper();
            ApiPersonCreditCardRequestModel model = new ApiPersonCreditCardRequestModel();

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

            response.CreditCardID.Should().Be(1);
            response.ModifiedDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM"));
        }
        public void MapRequestToResponse()
        {
            var mapper = new ApiPersonCreditCardModelMapper();
            var model  = new ApiPersonCreditCardRequestModel();

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

            response.BusinessEntityID.Should().Be(1);
            response.CreditCardID.Should().Be(1);
            response.ModifiedDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM"));
        }
        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"));
        }