public void Empty_Format_Returns_Type_Name() { // Arrange var msg = new TestMsg(); // Act var result = msg.ToString(); // Assert Assert.Equal(typeof(TestMsg).ToString(), result); }
public void Returns_Name_And_Value() { // Arrange var name = Rnd.Str; var value = Rnd.Int; var msg = new TestMsg(name, value); var expected = $"{typeof(TestMsg)} {name} = {value}"; // Act var result = msg.ToString(); // Assert Assert.Equal(expected, result); }
public void Returns_Formatted_String() { // Arrange var format = "{0} = {1}"; var a0 = Rnd.Str; var a1 = Rnd.Int; var msg = new TestMsg(format, a0, a1); var expected = $"{typeof(TestMsg)} {a0} = {a1}"; // Act var result = msg.ToString(); // Assert Assert.Equal(expected, result); }