Example #1
0
        public void ExceptionThrownStatic()
        {
            Tuple <int> myObject = null;

            Assert.Throws <NullReferenceException>(() =>
            {
                SafeFormatExtensions.SafeFormat("a{0}c", myObject.Item1);
            });
        }
Example #2
0
        public void StaticMethod()
        {
            var res = SafeFormatExtensions.SafeFormat("a{0}c", "b");

            res.Should().Be("abc");
        }
Example #3
0
        public void ForceOuterExcpetionStatic()
        {
            var res = SafeFormatExtensions.SafeFormat("a{0}c", new MyClass());

            res.Should().Be("Exception created for unit testing use.");
        }