public void ShouldBeEmptyIfDefaultOrPrimitive(object value)
        {
            var formatter = new DefaultFormFormatter();

            var result = formatter.Format(value);

            result.Should()
            .BeEmpty();
        }
        public void ShouldBeEquivalentToDictionary()
        {
            var expected = new Dictionary <string, string>
            {
                ["Key1"] = "value1",
                ["Key2"] = "value2",
            };

            var formatter = new DefaultFormFormatter();

            var result = formatter.Format(expected);

            result.ShouldBeEquivalentTo(expected);
        }
        public void ShouldFormatObjectWithoutAttributes()
        {
            var expected = new Dictionary <string, string>
            {
                ["Key1"] = "value1",
                ["Key2"] = "value2",
            };

            var value = new ObjectWithoutAttributes
            {
                Key1 = "value1",
                Key2 = "value2"
            };

            var formatter = new DefaultFormFormatter();

            var result = formatter.Format(value);

            result.ShouldBeEquivalentTo(expected);
        }
        public void ShouldFormatAnonymousType()
        {
            var expected = new Dictionary <string, string>
            {
                ["Key1"] = "value1",
                ["Key2"] = "value2",
            };

            var value = new
            {
                Key1 = "value1",
                Key2 = "value2"
            };

            var formatter = new DefaultFormFormatter();

            var result = formatter.Format(value);

            result.ShouldBeEquivalentTo(expected);
        }