Ejemplo n.º 1
0
        public void MapResponseToRequest()
        {
            var mapper = new ApiStudentXFamilyModelMapper();
            var model  = new ApiStudentXFamilyResponseModel();

            model.SetProperties(1, 1, 1);
            ApiStudentXFamilyRequestModel response = mapper.MapResponseToRequest(model);

            response.FamilyId.Should().Be(1);
            response.StudentId.Should().Be(1);
        }
Ejemplo n.º 2
0
        public async void TestUpdate()
        {
            var model = await this.CreateRecord();

            ApiStudentXFamilyModelMapper mapper = new ApiStudentXFamilyModelMapper();

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

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

            await this.Cleanup();
        }
Ejemplo n.º 3
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);
        }