Exemplo n.º 1
0
        public void MapModelToBO()
        {
            var mapper = new BOLVProductAndDescriptionMapper();
            ApiVProductAndDescriptionRequestModel model = new ApiVProductAndDescriptionRequestModel();

            model.SetProperties("A", "A", 1, "A");
            BOVProductAndDescription response = mapper.MapModelToBO("A", model);

            response.Description.Should().Be("A");
            response.Name.Should().Be("A");
            response.ProductID.Should().Be(1);
            response.ProductModel.Should().Be("A");
        }
Exemplo n.º 2
0
        public void MapRequestToResponse()
        {
            var mapper = new ApiVProductAndDescriptionModelMapper();
            var model  = new ApiVProductAndDescriptionRequestModel();

            model.SetProperties("A", "A", 1, "A");
            ApiVProductAndDescriptionResponseModel response = mapper.MapRequestToResponse("A", model);

            response.CultureID.Should().Be("A");
            response.Description.Should().Be("A");
            response.Name.Should().Be("A");
            response.ProductID.Should().Be(1);
            response.ProductModel.Should().Be("A");
        }
Exemplo n.º 3
0
        public void CreatePatch()
        {
            var mapper = new ApiVProductAndDescriptionModelMapper();
            var model  = new ApiVProductAndDescriptionRequestModel();

            model.SetProperties("A", "A", 1, "A");

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

            patch.ApplyTo(response);
            response.Description.Should().Be("A");
            response.Name.Should().Be("A");
            response.ProductID.Should().Be(1);
            response.ProductModel.Should().Be("A");
        }