Ejemplo n.º 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);
        }
Ejemplo n.º 2
0
        public void T0119_ToString_SomeValue_ReturnsThatValue()
        {
            string s = "Some value";
            LengthLimitedStringForTest lls = new LengthLimitedStringForTest(s);

            Assert.AreEqual(s, lls.ToString());
        }
Ejemplo n.º 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));
        }
Ejemplo n.º 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));
        }
Ejemplo n.º 5
0
        public void T0130_Equals_LengthLimitedString_Different_ReturnsFalse()
        {
            LengthLimitedStringForTest lls   = new LengthLimitedStringForTest("ABC");
            LengthLimitedStringForTest other = new LengthLimitedStringForTest("123");

            Assert.IsFalse(lls.Equals(other));
        }
Ejemplo n.º 6
0
        public void T0131_Equals_LengthLimitedString_Equal_ReturnsTrue()
        {
            LengthLimitedStringForTest lls   = new LengthLimitedStringForTest("ABC");
            LengthLimitedStringForTest other = new LengthLimitedStringForTest("ABC");

            Assert.IsTrue(lls.Equals(other));
        }
Ejemplo n.º 7
0
        public void T0101_Construct_NoParameter_ReturnsObjectWithNullValue()
        {
            LengthLimitedStringForTest lls = new LengthLimitedStringForTest();

            Assert.IsNotNull(lls);
            Assert.IsNull(lls.Value);
        }
Ejemplo n.º 8
0
        public void T0122_GetHashCode_SomeValue_ReturnsSameAsForString()
        {
            string s = "Some value";
            LengthLimitedStringForTest lls = new LengthLimitedStringForTest(s);

            Assert.AreEqual(s.GetHashCode(), lls.GetHashCode());
        }
Ejemplo n.º 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));
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 11
0
        public void T0102_Construct_Null_ReturnsObjectWithNullValue()
        {
            string s = null;
            LengthLimitedStringForTest lls = new LengthLimitedStringForTest(s);

            Assert.IsNotNull(lls);
            Assert.IsNull(lls.Value);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 14
0
 public LengthLimitedStringForTest(LengthLimitedStringForTest other) : base(other)
 {
 }
Ejemplo n.º 15
0
        public void T0113_IsNullOrWhiteSpace_Null_ReturnsTrue()
        {
            LengthLimitedStringForTest lls = new LengthLimitedStringForTest();

            Assert.IsTrue(lls.IsNullOrWhiteSpace());
        }
Ejemplo n.º 16
0
        public void T0114_IsNullOrWhiteSpace_Empty_ReturnsTrue()
        {
            LengthLimitedStringForTest lls = new LengthLimitedStringForTest(string.Empty);

            Assert.IsTrue(lls.IsNullOrWhiteSpace());
        }
Ejemplo n.º 17
0
        public void T0129_Equals_NotLengthLimitedString_ReturnsFalse()
        {
            LengthLimitedStringForTest lls = new LengthLimitedStringForTest();

            Assert.IsFalse(lls.Equals(new object()));
        }
Ejemplo n.º 18
0
        public void T0128_Equals_Null_ReturnsFalse()
        {
            LengthLimitedStringForTest lls = new LengthLimitedStringForTest();

            Assert.IsFalse(lls.Equals(null));
        }
Ejemplo n.º 19
0
        public void T0115_IsNullOrWhiteSpace_WhitespaceOnly_ReturnsTrue()
        {
            LengthLimitedStringForTest lls = new LengthLimitedStringForTest("\t\r\n ");

            Assert.IsTrue(lls.IsNullOrWhiteSpace());
        }
Ejemplo n.º 20
0
        public void T0116_IsNullOrWhiteSpace_SomeValue_ReturnsFalse()
        {
            LengthLimitedStringForTest lls = new LengthLimitedStringForTest("Bla bla bla");

            Assert.IsFalse(lls.IsNullOrWhiteSpace());
        }
Ejemplo n.º 21
0
        public void T0112_IsNullOrEmpty_SomeValue_ReturnsFalse()
        {
            LengthLimitedStringForTest lls = new LengthLimitedStringForTest("Bla bla bla");

            Assert.IsFalse(lls.IsNullOrEmpty());
        }
Ejemplo n.º 22
0
        public void T0118_ToString_Empty_ReturnsEmptyString()
        {
            LengthLimitedStringForTest lls = new LengthLimitedStringForTest(string.Empty);

            Assert.AreEqual(string.Empty, lls.ToString());
        }
Ejemplo n.º 23
0
        public void T0120_GetHashCode_Null_ReturnsZero()
        {
            LengthLimitedStringForTest lls = new LengthLimitedStringForTest();

            Assert.AreEqual(0, lls.GetHashCode());
        }
Ejemplo n.º 24
0
        public void T0121_GetHashCode_Empty_ReturnsSameAsForString()
        {
            LengthLimitedStringForTest lls = new LengthLimitedStringForTest(string.Empty);

            Assert.AreEqual(string.Empty.GetHashCode(), lls.GetHashCode());
        }
Ejemplo n.º 25
0
 public void T0105_Construct_TooLong_ThrowsException()
 {
     string s = new string('X', LengthLimitedStringForTest.MaximumLength + 1);
     LengthLimitedStringForTest lls = new LengthLimitedStringForTest(s);
 }
Ejemplo n.º 26
0
        public void T0123_CompareTo_Null_ReturnsOne()
        {
            LengthLimitedStringForTest lls = new LengthLimitedStringForTest();

            Assert.AreEqual(1, lls.CompareTo(null));
        }
Ejemplo n.º 27
0
        public void T0107_MaxLength_CorrectSet()
        {
            LengthLimitedStringForTest lls = new LengthLimitedStringForTest();

            Assert.AreEqual(LengthLimitedStringForTest.MaximumLength, lls.MaxLength);
        }
Ejemplo n.º 28
0
        public void T0124_CompareTo_NotLengthLimitedString_ThrowsException()
        {
            LengthLimitedStringForTest lls = new LengthLimitedStringForTest();

            lls.CompareTo(new object());
        }
Ejemplo n.º 29
0
        public void T0109_IsNullOrEmpty_Null_ReturnsTrue()
        {
            LengthLimitedStringForTest lls = new LengthLimitedStringForTest();

            Assert.IsTrue(lls.IsNullOrEmpty());
        }
Ejemplo n.º 30
0
        public void T0111_IsNullOrEmpty_WhitespaceOnly_ReturnsFalse()
        {
            LengthLimitedStringForTest lls = new LengthLimitedStringForTest("\t\r\n ");

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