private async Task <ApiProductModelResponseModel> CreateRecord()
        {
            var model = new ApiProductModelRequestModel();

            model.SetProperties("B", "B", DateTime.Parse("1/1/1988 12:00:00 AM"), "B", Guid.Parse("3842cac4-b9a0-8223-0dcc-509a6f75849b"));
            CreateResponse <ApiProductModelResponseModel> result = await this.Client.ProductModelCreateAsync(model);

            result.Success.Should().BeTrue();
            return(result.Record);
        }
Ejemplo n.º 2
0
        public void MapModelToBO()
        {
            var mapper = new BOLProductModelMapper();
            ApiProductModelRequestModel model = new ApiProductModelRequestModel();

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

            response.CatalogDescription.Should().Be("A");
            response.Instruction.Should().Be("A");
            response.ModifiedDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM"));
            response.Name.Should().Be("A");
            response.Rowguid.Should().Be(Guid.Parse("8420cdcf-d595-ef65-66e7-dff9f98764da"));
        }
Ejemplo n.º 3
0
        public void CreatePatch()
        {
            var mapper = new ApiProductModelModelMapper();
            var model  = new ApiProductModelRequestModel();

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

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

            patch.ApplyTo(response);
            response.CatalogDescription.Should().Be("A");
            response.Instruction.Should().Be("A");
            response.ModifiedDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM"));
            response.Name.Should().Be("A");
            response.Rowguid.Should().Be(Guid.Parse("8420cdcf-d595-ef65-66e7-dff9f98764da"));
        }