ArgsTests.ConsoleStringTests.TestConsoleStringEdgeCases C# (CSharp) Метод

TestConsoleStringEdgeCases() приватный Метод

private TestConsoleStringEdgeCases ( ) : void
Результат void
        public void TestConsoleStringEdgeCases()
        {
            ConsoleString str = ConsoleString.Empty;
            for(int i = 0; i < 99; i++) str+=("");

            Assert.AreEqual(0, str.Length);
            Assert.AreEqual(string.Empty, str.ToString());
            Assert.AreEqual(ConsoleString.Empty, str);

            ConsoleString noSegments = new ConsoleString();
            noSegments = noSegments.AppendUsingCurrentFormat("Adam");
            ValidateStringCharacteristics("Adam", noSegments);

            ConsoleString nullString = null;
            Assert.IsTrue(nullString == null);
            nullString = nullString + new ConsoleString("Adam");
            Assert.AreEqual(nullString, new ConsoleString("Adam"));

            nullString = null;
            Assert.IsTrue(nullString == null);
            Assert.IsFalse(nullString != null);
            nullString = nullString + "Adam";
            Assert.AreEqual(nullString, new ConsoleString("Adam"));
            Assert.IsTrue(nullString != null);
            Assert.IsFalse(new ConsoleCharacter('a').Equals(null));
            Assert.IsFalse(new ConsoleCharacter('a').Equals(0));

            new ConsoleCharacter('a').GetHashCode();
            new ConsoleString("Adam").GetHashCode();

            Assert.IsTrue(new ConsoleString("Adam").Equals("Adam"));
            Assert.IsTrue(new ConsoleCharacter('A').Equals('A'));

            Assert.IsTrue(new ConsoleCharacter('A') == 'A');
            Assert.IsTrue(new ConsoleCharacter('A') != 'B');
            Assert.IsFalse(new ConsoleCharacter('A') == null);
            Assert.IsTrue(new ConsoleCharacter('A') != null);

            Assert.IsTrue(new ConsoleCharacter('A') == new ConsoleCharacter('A'));
            Assert.IsTrue(new ConsoleCharacter('A') != new ConsoleCharacter('B'));

            Assert.IsTrue(new ConsoleString("A") == new ConsoleString("A"));
            Assert.IsTrue(new ConsoleString("A") != new ConsoleString("B"));

            Assert.IsFalse(null == new ConsoleString("A"));
            Assert.IsTrue(null != new ConsoleString("B"));

            Assert.IsFalse(new ConsoleString("A") == null);
            Assert.IsTrue(new ConsoleString("A") != null);

            Assert.AreEqual(new ConsoleString("A"), null + new ConsoleString("A"));

            ConsoleString nulla = null;
            ConsoleString nullb = null;
            string nullS = null;

            Assert.AreEqual(null, nulla + nullb);
            Assert.AreEqual(null, nulla + nullS);
        }