private async Task <ApiPhoneNumberTypeResponseModel> CreateRecord()
        {
            var model = new ApiPhoneNumberTypeRequestModel();

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

            result.Success.Should().BeTrue();
            return(result.Record);
        }
예제 #2
0
        public void MapModelToBO()
        {
            var mapper = new BOLPhoneNumberTypeMapper();
            ApiPhoneNumberTypeRequestModel model = new ApiPhoneNumberTypeRequestModel();

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

            response.ModifiedDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM"));
            response.Name.Should().Be("A");
        }
예제 #3
0
        public void MapRequestToResponse()
        {
            var mapper = new ApiPhoneNumberTypeModelMapper();
            var model  = new ApiPhoneNumberTypeRequestModel();

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

            response.ModifiedDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM"));
            response.Name.Should().Be("A");
            response.PhoneNumberTypeID.Should().Be(1);
        }
예제 #4
0
        public void CreatePatch()
        {
            var mapper = new ApiPhoneNumberTypeModelMapper();
            var model  = new ApiPhoneNumberTypeRequestModel();

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

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

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