void converting_dynamic_model()
        {
            before = () =>
            {
                objectToConvert = new SomeDynamicModel(new { Id = 20, Title = "SomeTitle" });
            };

            act = () => jsonString = DynamicToJson.Convert(objectToConvert);

            it["includes both properties from hash and properties defined on dynamic model"] = () =>
            {
                string expected = @"{ ""id"": 20, ""title"": ""SomeTitle"", ""name"": ""SomeName"" }";

                jsonString.should_be(expected);
            };
        }
Example #2
0
        void converting_dynamic_model()
        {
            before = () =>
            {
                objectToConvert = new SomeDynamicModel(new { Id = 20, Title = "SomeTitle" });
            };

            act = () => jsonString = DynamicToJson.Convert(objectToConvert);

            it["includes both properties from hash and properties defined on dynamic model"] = () =>
            {
                string expected = @"{ ""id"": 20, ""title"": ""SomeTitle"", ""name"": ""SomeName"" }";

                jsonString.should_be(expected);
            };
        }