Exemple #1
0
        private async Task <ApiLessonXStudentResponseModel> CreateRecord()
        {
            var model = new ApiLessonXStudentRequestModel();

            model.SetProperties(1, 1);
            CreateResponse <ApiLessonXStudentResponseModel> result = await this.Client.LessonXStudentCreateAsync(model);

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

            model.SetProperties(1, 1);
            BOLessonXStudent response = mapper.MapModelToBO(1, model);

            response.LessonId.Should().Be(1);
            response.StudentId.Should().Be(1);
        }
Exemple #3
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);
        }
Exemple #4
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);
        }