Exemple #1
0
        public void CreatePatch()
        {
            var mapper = new ApiAdminModelMapper();
            var model  = new ApiAdminRequestModel();

            model.SetProperties(DateTime.Parse("1/1/1987 12:00:00 AM"), "A", "A", "A", "A", 1);

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

            patch.ApplyTo(response);
            response.Birthday.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM"));
            response.Email.Should().Be("A");
            response.FirstName.Should().Be("A");
            response.LastName.Should().Be("A");
            response.Phone.Should().Be("A");
            response.StudioId.Should().Be(1);
        }
        public void CreatePatch()
        {
            var mapper = new ApiAdminModelMapper();
            var model  = new ApiAdminRequestModel();

            model.SetProperties("A", "A", "A", "A", "A", "A");

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

            patch.ApplyTo(response);
            response.Email.Should().Be("A");
            response.FirstName.Should().Be("A");
            response.LastName.Should().Be("A");
            response.Password.Should().Be("A");
            response.Phone.Should().Be("A");
            response.Username.Should().Be("A");
        }