Exemplo n.º 1
0
        public void ShouldImplementEquality()
        {
            var hello       = new StringType("Hello");
            var there       = new StringType("There");
            var otherHello  = new OtherStringType("Hello");
            var otherHello2 = new OtherStringType("Hello");

            Assert.That(hello.Equals(there), Is.False);
            Assert.That(hello.Equals(otherHello), Is.False);
            Assert.That(hello.Equals(otherHello2), Is.False);
            Assert.That(there.Equals(hello), Is.False);
            Assert.That(there.Equals(otherHello), Is.False);
            Assert.That(otherHello.Equals(otherHello2), Is.True);
        }
Exemplo n.º 2
0
        public void ShouldCreateStringlyTyped()
        {
            var iType  = new IntegerType(123);
            var sType  = new StringType("Hello");
            var sType2 = new OtherStringType("World");

            Assert.That(iType.Value, Is.EqualTo(123));
            Assert.That(sType.Value, Is.EqualTo("Hello"));
            Assert.That(sType2.Value, Is.EqualTo("World"));

            Assert.That(iType, Is.Not.EqualTo(123));
            Assert.That(sType, Is.Not.EqualTo("Hello"));
            Assert.That(sType2, Is.Not.EqualTo("World"));
        }