public static void Main() { TestToString test = new TestToString(); test.CallToString1(); Console.WriteLine(); test.CallToString2(); Console.WriteLine(); test.CallToString3(); }
public void TestString() { var converter = _converterBuilder.BuildConverter(typeof(string)); const string expectedValue = "thisIsATest"; var valueToConvert = new TestToString(expectedValue); object convertedValue = converter(valueToConvert); Assert.IsInstanceOf <string>(convertedValue); Assert.AreEqual(expectedValue, convertedValue); Assert.IsNull(converter(null)); }