Exemple #1
0
        public void apply_json_changes_integrated_tester()
        {
            // I'm starting with a test with 2 comments, adding one comment
            // from the json, then converting back to the test.  The test should
            // only have the new comment afterwards
            var test = new Test("test1", x =>
            {
                x.Add(new Comment("some text"));
                x.Add(new Comment("some other text"));
            });

            var test2 = test.Clone("something");

            test2.Add(new Comment("another"));

            var json = new TestWriter().WriteToJson(test2);

            theConverter.ApplyJsonChanges(test, json);
            test.Parts.Count.ShouldEqual(3);
            test.Parts.Last().ShouldBeOfType <Comment>().Text.ShouldEqual("another");
        }