Exemple #1
0
        public void Equals_DifferentEncodingAreNotEqual()
        {
            var bstring1 = new BString("ø");
            var bstring2 = new BString("ø", Encoding.ASCII);

            bstring1.Equals(bstring2).Should().BeFalse();
            bstring2.Equals(bstring1).Should().BeFalse();
        }
Exemple #2
0
        public void Equals_SameContentShouldBeEqual(string str1, string str2)
        {
            var bstring1 = new BString(str1);
            var bstring2 = new BString(str2);

            bstring1.Equals(bstring2).Should().BeTrue();
            bstring2.Equals(bstring1).Should().BeTrue();
        }
Exemple #3
0
        public void Equals_DifferentContentShouldNotBeEqual(string str1, string str2)
        {
            var bstring1 = new BString(str1);
            var bstring2 = new BString(str2);

            bstring1.Equals(bstring2).Should().BeFalse();
            bstring2.Equals(bstring1).Should().BeFalse();
        }
Exemple #4
0
        public void Equals_SameContentShouldBeEqual(string str1, string str2)
        {
            var bstring1 = new BString(str1);
            var bstring2 = new BString(str2);

            bstring1.Equals(bstring2).Should().BeTrue();
            bstring2.Equals(bstring1).Should().BeTrue();
        }
Exemple #5
0
        public void Equals_DifferentEncodingAreNotEqual()
        {
            var bstring1 = new BString("ø");
            var bstring2 = new BString("ø", Encoding.ASCII);

            bstring1.Equals(bstring2).Should().BeFalse();
            bstring2.Equals(bstring1).Should().BeFalse();
        }
Exemple #6
0
        public void Equals_DifferentContentShouldNotBeEqual(string str1, string str2)
        {
            var bstring1 = new BString(str1);
            var bstring2 = new BString(str2);

            bstring1.Equals(bstring2).Should().BeFalse();
            bstring2.Equals(bstring1).Should().BeFalse();
        }
        public void EqualityString()
        {
            BString testString = new BString("Hello World");
            BString testString2 = new BString("Hello World");

            Assert.AreEqual(testString, testString2);
            Assert.IsTrue(testString.Equals(testString2.Value));
            Assert.IsTrue(testString.Equals(testString));
        }
        public void EqualityNulls()
        {
            object testObjectNull = null;

            BInt testInt = new BInt(5);
            BInt testIntNull = null;

            Assert.IsFalse(testInt.Equals(testIntNull));
            Assert.IsFalse(testInt.Equals(testObjectNull));

            BString testString = new BString("");
            BString testStringNull = null;
            string testStringNull2 = null;

            Assert.IsFalse(testString.Equals(testStringNull));
            Assert.IsFalse(testString.Equals(testStringNull2));
            Assert.IsFalse(testString.Equals(testObjectNull));
        }