private async Task <ApiProductReviewResponseModel> CreateRecord(ApiClient client)
        {
            var model = new ApiProductReviewRequestModel();

            model.SetProperties("B", "B", DateTime.Parse("1/1/1988 12:00:00 AM"), 2, 2, DateTime.Parse("1/1/1988 12:00:00 AM"), "B");
            CreateResponse <ApiProductReviewResponseModel> result = await client.ProductReviewCreateAsync(model);

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

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

            response.Comment.Should().Be("A");
            response.EmailAddress.Should().Be("A");
            response.ModifiedDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM"));
            response.ProductID.Should().Be(1);
            response.Rating.Should().Be(1);
            response.ReviewDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM"));
            response.ReviewerName.Should().Be("A");
        }
예제 #3
0
        public void CreatePatch()
        {
            var mapper = new ApiProductReviewModelMapper();
            var model  = new ApiProductReviewRequestModel();

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

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

            patch.ApplyTo(response);
            response.Comment.Should().Be("A");
            response.EmailAddress.Should().Be("A");
            response.ModifiedDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM"));
            response.ProductID.Should().Be(1);
            response.Rating.Should().Be(1);
            response.ReviewDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM"));
            response.ReviewerName.Should().Be("A");
        }