예제 #1
0
        public void MapResponseToRequest()
        {
            var mapper = new ApiCommentsModelMapper();
            var model  = new ApiCommentsResponseModel();

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

            response.CreationDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM"));
            response.PostId.Should().Be(1);
            response.Score.Should().Be(1);
            response.Text.Should().Be("A");
            response.UserId.Should().Be(1);
        }
예제 #2
0
        public async void TestUpdate()
        {
            var model = await this.CreateRecord();

            ApiCommentsModelMapper mapper = new ApiCommentsModelMapper();

            UpdateResponse <ApiCommentsResponseModel> updateResponse = await this.Client.CommentsUpdateAsync(model.Id, mapper.MapResponseToRequest(model));

            updateResponse.Record.Should().NotBeNull();
            updateResponse.Success.Should().BeTrue();

            await this.Cleanup();
        }