예제 #1
0
        public void CastValidValueTest()
        {
            object input = "123";

            var result = SafeCast.Cast <string>(input, "text {0}", "text");

            Assert.AreEqual(input, result);
        }
예제 #2
0
        public void CastInvalidValueTest()
        {
            var action = new TestDelegate(() => SafeCast.Cast <string>(new object(), "text {0}", "text"));

            Assert.That(action, Throws.InvalidOperationException);
        }