public void CastValidValueTest() { object input = "123"; var result = SafeCast.Cast <string>(input, "text {0}", "text"); Assert.AreEqual(input, result); }
public void CastInvalidValueTest() { var action = new TestDelegate(() => SafeCast.Cast <string>(new object(), "text {0}", "text")); Assert.That(action, Throws.InvalidOperationException); }