예제 #1
0
        public void RunTest(string testCaseName)
        {
            var testCase = GetTestCase($"defaultr/{testCaseName}");

            var defaultr = new Defaultr(testCase.Spec);
            var actual   = defaultr.Transform(testCase.Input);

            actual.Should().BeEquivalentTo(testCase.Expected);
        }
예제 #2
0
        public void DeepCopyTest()
        {
            var testCase = GetTestCase("defaultr/__deepCopyTest");

            Defaultr defaultr = new Defaultr(testCase.Spec);
            {
                var fiddle = defaultr.Transform(testCase.Input);

                var array = (JArray)fiddle["array"];
                array.Add("a");

                var subMap = (JObject)fiddle["map"];
                subMap["c"] = "c";
            }
            {
                var testCase2 = GetTestCase("defaultr/__deepCopyTest");

                var actual = defaultr.Transform(testCase2.Input);
                actual.Should().BeEquivalentTo(testCase2.Expected);
            }
        }