public void SerializeArgument_WorksForEnumerableObjectProperty() { // Arrange var args = new MockArgs(); args.EnumerableObject = new MockArgs.MockObject[] { new MockArgs.MockObject { Int = 1, String = "a", Object = null }, new MockArgs.MockObject { Int = 2, String = "", Object = false }, }; // Act var result = args.SerializeArgument(nameof(MockArgs.EnumerableObject)); // Assert Assert.Equal("-enumerable_object:\"Int=1;String=a;\" -enumerable_object:\"Int=2;String=;Object=False;\"", result); }
public void SerializeArgument_WorksForEnumerableProperty() { // Arrange var args = new MockArgs(); args.Enumerable = new object[] { "a", 1, true }; // Act var result = args.SerializeArgument(nameof(MockArgs.Enumerable)); // Assert Assert.Equal("-enumerable:\"a\" -enumerable:\"1\" -enumerable:\"True\"", result); }
public void SerializeArgument_WorksForProperty_SetByKey_GetProperty() { // Arrange var args = new MockArgs(); args["argument"] = "value"; // Act var result = args.SerializeArgument(nameof(MockArgs.Argument)); // Assert Assert.Equal("-argument:\"value\"", result); }
public void SerializeArgument_WorksForObjectProperty() { // Arrange var args = new MockArgs(); args.Object = new MockArgs.MockObject { Int = 1, String = "a", Object = null }; // Act var result = args.SerializeArgument(nameof(MockArgs.Object)); // Assert Assert.Equal("-object:\"Int=1;String=a;\"", result); }