Beispiel #1
0
        public void Serialize_WorksForKeysAndProperties()
        {
            // Arrange
            Args args = new MockArgs
            {
                ["boolean"] = true,
                ["String"]  = "somevalue",
                ["int"]     = 15,

                Enumerable = new[] { "1", "a" },
                Object     = new MockArgs.MockObject {
                    Int = 1, String = "string"
                },
                Argument = false
            };
            // Act
            var result = args.Serialize();

            // Assert
            Assert.Contains("-argument:\"False\"", result);
            Assert.Contains("-enumerable:\"1\" -enumerable:\"a\"", result);
            Assert.Contains("-object:\"Int=1;String=string;\"", result);
            Assert.Contains("-boolean:\"True\"", result);
            Assert.Contains("-String:\"somevalue\"", result);
            Assert.Contains("-int:\"15\"", result);
        }
Beispiel #2
0
        public void Serialize_WorksForProperties()
        {
            // Arrange
            Args args = new MockArgs
            {
                Enumerable = new[] { "1", "a" },
                Object     = new MockArgs.MockObject {
                    Int = 1, String = "string"
                },
                Argument = false
            };
            // Act
            var result = args.Serialize();

            // Assert
            Assert.Contains("-argument:\"False\"", result);
            Assert.Contains("-enumerable:\"1\" -enumerable:\"a\"", result);
            Assert.Contains("-object:\"Int=1;String=string;\"", result);
        }