예제 #1
0
        public void TestStripMetadata()
        {
            // Arrange
            JToken input = JToken.FromObject(
                new Dictionary <string, object>
            {
                { "foo", 10 },
                { "bar", 20 },
                { "$metadata", new { baz = 30 } },
                { "$version", 40 }
            });

            // Act
            JsonEx.StripMetadata(input);

            // Assert
            JToken expected = JToken.FromObject(
                new
            {
                foo = 10,
                bar = 20
            });

            Assert.True(JToken.DeepEquals(expected, input));
        }