Aspectacular.CoreTests.StringExtTests.TruncatedStringTest C# (CSharp) Method

TruncatedStringTest() private method

private TruncatedStringTest ( ) : void
return void
        public void TruncatedStringTest()
        {
            TestTruncatedString ts = new TestTruncatedString("Short string", 10000, "doesn't matter");
            Assert.AreEqual(ts, "Short string");

            ts = new TestTruncatedString("Short string", 5, "........very long ellipsis......");
            Assert.AreEqual(ts, "Short");

            ts = new TestTruncatedString("Whatever", 7);
            Assert.AreEqual(ts, "What...");

            ts = new TestTruncatedString("Very long string", 4, null);
            Assert.AreEqual(ts, "Very");

            ts = new TestTruncatedString("Very long string", 10);
            Assert.AreEqual(ts, "Very lo...");

            String255 s255 =
                "By eliminating unnecessary casts, implicit conversions can improve source code readability. However, because implicit conversions do not require programmers to explicitly cast from one type to the other, care must be taken to prevent unexpected results. In general, implicit conversion operators should never throw exceptions and never lose information so that they can be used safely without the programmer's awareness. If a conversion operator cannot meet those criteria, it should be marked explicit. For more information, see Using Conversion Operators.";
            string actual = s255;
            Assert.AreEqual(255, actual.Length);
        }