Beispiel #1
0
        private async Task <ApiStudentXFamilyResponseModel> CreateRecord()
        {
            var model = new ApiStudentXFamilyRequestModel();

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

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

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

            response.FamilyId.Should().Be(1);
            response.StudentId.Should().Be(1);
        }
Beispiel #3
0
        public void MapRequestToResponse()
        {
            var mapper = new ApiStudentXFamilyModelMapper();
            var model  = new ApiStudentXFamilyRequestModel();

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

            response.FamilyId.Should().Be(1);
            response.Id.Should().Be(1);
            response.StudentId.Should().Be(1);
        }
Beispiel #4
0
        public void CreatePatch()
        {
            var mapper = new ApiStudentXFamilyModelMapper();
            var model  = new ApiStudentXFamilyRequestModel();

            model.SetProperties(1, 1);

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

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