示例#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());
        }