private async Task <ApiPostLinksResponseModel> CreateRecord()
        {
            var model = new ApiPostLinksRequestModel();

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

            result.Success.Should().BeTrue();
            return(result.Record);
        }
Example #2
0
        public void MapModelToBO()
        {
            var mapper = new BOLPostLinksMapper();
            ApiPostLinksRequestModel model = new ApiPostLinksRequestModel();

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

            response.CreationDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM"));
            response.LinkTypeId.Should().Be(1);
            response.PostId.Should().Be(1);
            response.RelatedPostId.Should().Be(1);
        }
        public void CreatePatch()
        {
            var mapper = new ApiPostLinksModelMapper();
            var model  = new ApiPostLinksRequestModel();

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

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

            patch.ApplyTo(response);
            response.CreationDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM"));
            response.LinkTypeId.Should().Be(1);
            response.PostId.Should().Be(1);
            response.RelatedPostId.Should().Be(1);
        }