Example #1
0
        public void MapRequestToResponse()
        {
            var mapper = new ApiLessonXStudentModelMapper();
            var model  = new ApiLessonXStudentRequestModel();

            model.SetProperties(1, 1);
            ApiLessonXStudentResponseModel response = mapper.MapRequestToResponse(1, model);

            response.Id.Should().Be(1);
            response.LessonId.Should().Be(1);
            response.StudentId.Should().Be(1);
        }
Example #2
0
        public async void TestUpdate()
        {
            var model = await this.CreateRecord();

            ApiLessonXStudentModelMapper mapper = new ApiLessonXStudentModelMapper();

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

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

            await this.Cleanup();
        }
Example #3
0
        public void CreatePatch()
        {
            var mapper = new ApiLessonXStudentModelMapper();
            var model  = new ApiLessonXStudentRequestModel();

            model.SetProperties(1, 1);

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

            patch.ApplyTo(response);
            response.LessonId.Should().Be(1);
            response.StudentId.Should().Be(1);
        }