Пример #1
0
        public void T0108_Value_CorrectSet()
        {
            string s = "Some arbitrary value (not too long, though)";
            LengthLimitedStringForTest lls = new LengthLimitedStringForTest(s);

            Assert.AreEqual(s, lls.Value);
        }
Пример #2
0
        public void T0119_ToString_SomeValue_ReturnsThatValue()
        {
            string s = "Some value";
            LengthLimitedStringForTest lls = new LengthLimitedStringForTest(s);

            Assert.AreEqual(s, lls.ToString());
        }
Пример #3
0
        public void T0127_CompareTo_LengthLimitedString_Larger_ReturnsMinusOne()
        {
            LengthLimitedStringForTest lls   = new LengthLimitedStringForTest("1");
            LengthLimitedStringForTest other = new LengthLimitedStringForTest("2");

            Assert.AreEqual(-1, lls.CompareTo(other));
        }
Пример #4
0
        public void T0126_CompareTo_LengthLimitedString_Equal_ReturnsZero()
        {
            LengthLimitedStringForTest lls   = new LengthLimitedStringForTest("1");
            LengthLimitedStringForTest other = new LengthLimitedStringForTest("1");

            Assert.AreEqual(0, lls.CompareTo(other));
        }
Пример #5
0
        public void T0130_Equals_LengthLimitedString_Different_ReturnsFalse()
        {
            LengthLimitedStringForTest lls   = new LengthLimitedStringForTest("ABC");
            LengthLimitedStringForTest other = new LengthLimitedStringForTest("123");

            Assert.IsFalse(lls.Equals(other));
        }
Пример #6
0
        public void T0131_Equals_LengthLimitedString_Equal_ReturnsTrue()
        {
            LengthLimitedStringForTest lls   = new LengthLimitedStringForTest("ABC");
            LengthLimitedStringForTest other = new LengthLimitedStringForTest("ABC");

            Assert.IsTrue(lls.Equals(other));
        }
Пример #7
0
        public void T0101_Construct_NoParameter_ReturnsObjectWithNullValue()
        {
            LengthLimitedStringForTest lls = new LengthLimitedStringForTest();

            Assert.IsNotNull(lls);
            Assert.IsNull(lls.Value);
        }
Пример #8
0
        public void T0122_GetHashCode_SomeValue_ReturnsSameAsForString()
        {
            string s = "Some value";
            LengthLimitedStringForTest lls = new LengthLimitedStringForTest(s);

            Assert.AreEqual(s.GetHashCode(), lls.GetHashCode());
        }
Пример #9
0
        public void T0125_CompareTo_LengthLimitedString_Smaller_ReturnsPlusOne()
        {
            LengthLimitedStringForTest lls   = new LengthLimitedStringForTest("2");
            LengthLimitedStringForTest other = new LengthLimitedStringForTest("1");

            Assert.AreEqual(1, lls.CompareTo(other));
        }
Пример #10
0
        public void T0103_Construct_Empty_ReturnsObjectWithEmptyValue()
        {
            string s = string.Empty;
            LengthLimitedStringForTest lls = new LengthLimitedStringForTest(s);

            Assert.IsNotNull(lls);
            Assert.AreEqual(string.Empty, lls.Value);
        }
Пример #11
0
        public void T0102_Construct_Null_ReturnsObjectWithNullValue()
        {
            string s = null;
            LengthLimitedStringForTest lls = new LengthLimitedStringForTest(s);

            Assert.IsNotNull(lls);
            Assert.IsNull(lls.Value);
        }
Пример #12
0
        public void T0106_Construct_Copy_Identical()
        {
            string s = "Some arbitrary value (not too long, though)";
            LengthLimitedStringForTest original = new LengthLimitedStringForTest(s);
            LengthLimitedStringForTest copy     = new LengthLimitedStringForTest(original);

            Assert.AreEqual(s, copy.Value);
        }
Пример #13
0
        public void T0104_Construct_AcceptableLengthValue_ReturnsObjectWithPassedValue()
        {
            string s = new string('X', LengthLimitedStringForTest.MaximumLength);
            LengthLimitedStringForTest lls = new LengthLimitedStringForTest(s);

            Assert.IsNotNull(lls);
            Assert.AreEqual(s, lls.Value);
        }
Пример #14
0
 public LengthLimitedStringForTest(LengthLimitedStringForTest other) : base(other)
 {
 }
Пример #15
0
        public void T0113_IsNullOrWhiteSpace_Null_ReturnsTrue()
        {
            LengthLimitedStringForTest lls = new LengthLimitedStringForTest();

            Assert.IsTrue(lls.IsNullOrWhiteSpace());
        }
Пример #16
0
        public void T0114_IsNullOrWhiteSpace_Empty_ReturnsTrue()
        {
            LengthLimitedStringForTest lls = new LengthLimitedStringForTest(string.Empty);

            Assert.IsTrue(lls.IsNullOrWhiteSpace());
        }
Пример #17
0
        public void T0129_Equals_NotLengthLimitedString_ReturnsFalse()
        {
            LengthLimitedStringForTest lls = new LengthLimitedStringForTest();

            Assert.IsFalse(lls.Equals(new object()));
        }
Пример #18
0
        public void T0128_Equals_Null_ReturnsFalse()
        {
            LengthLimitedStringForTest lls = new LengthLimitedStringForTest();

            Assert.IsFalse(lls.Equals(null));
        }
Пример #19
0
        public void T0115_IsNullOrWhiteSpace_WhitespaceOnly_ReturnsTrue()
        {
            LengthLimitedStringForTest lls = new LengthLimitedStringForTest("\t\r\n ");

            Assert.IsTrue(lls.IsNullOrWhiteSpace());
        }
Пример #20
0
        public void T0116_IsNullOrWhiteSpace_SomeValue_ReturnsFalse()
        {
            LengthLimitedStringForTest lls = new LengthLimitedStringForTest("Bla bla bla");

            Assert.IsFalse(lls.IsNullOrWhiteSpace());
        }
Пример #21
0
        public void T0112_IsNullOrEmpty_SomeValue_ReturnsFalse()
        {
            LengthLimitedStringForTest lls = new LengthLimitedStringForTest("Bla bla bla");

            Assert.IsFalse(lls.IsNullOrEmpty());
        }
Пример #22
0
        public void T0118_ToString_Empty_ReturnsEmptyString()
        {
            LengthLimitedStringForTest lls = new LengthLimitedStringForTest(string.Empty);

            Assert.AreEqual(string.Empty, lls.ToString());
        }
Пример #23
0
        public void T0120_GetHashCode_Null_ReturnsZero()
        {
            LengthLimitedStringForTest lls = new LengthLimitedStringForTest();

            Assert.AreEqual(0, lls.GetHashCode());
        }
Пример #24
0
        public void T0121_GetHashCode_Empty_ReturnsSameAsForString()
        {
            LengthLimitedStringForTest lls = new LengthLimitedStringForTest(string.Empty);

            Assert.AreEqual(string.Empty.GetHashCode(), lls.GetHashCode());
        }
Пример #25
0
 public void T0105_Construct_TooLong_ThrowsException()
 {
     string s = new string('X', LengthLimitedStringForTest.MaximumLength + 1);
     LengthLimitedStringForTest lls = new LengthLimitedStringForTest(s);
 }
Пример #26
0
        public void T0123_CompareTo_Null_ReturnsOne()
        {
            LengthLimitedStringForTest lls = new LengthLimitedStringForTest();

            Assert.AreEqual(1, lls.CompareTo(null));
        }
Пример #27
0
        public void T0107_MaxLength_CorrectSet()
        {
            LengthLimitedStringForTest lls = new LengthLimitedStringForTest();

            Assert.AreEqual(LengthLimitedStringForTest.MaximumLength, lls.MaxLength);
        }
Пример #28
0
        public void T0124_CompareTo_NotLengthLimitedString_ThrowsException()
        {
            LengthLimitedStringForTest lls = new LengthLimitedStringForTest();

            lls.CompareTo(new object());
        }
Пример #29
0
        public void T0109_IsNullOrEmpty_Null_ReturnsTrue()
        {
            LengthLimitedStringForTest lls = new LengthLimitedStringForTest();

            Assert.IsTrue(lls.IsNullOrEmpty());
        }
Пример #30
0
        public void T0111_IsNullOrEmpty_WhitespaceOnly_ReturnsFalse()
        {
            LengthLimitedStringForTest lls = new LengthLimitedStringForTest("\t\r\n ");

            Assert.IsFalse(lls.IsNullOrEmpty());
        }