Ejemplo n.º 1
0
        public void ReferenceEqualFail()
        {
            var left  = new HoldemBattle.Models.Card(GameValues.Suit.Spade, GameValues.Value.Three);
            var right = (object)new HoldemBattle.Models.Card(GameValues.Suit.Spade, GameValues.Value.Two);

            Assert.IsFalse(left.Equals(right), "Both objects have different values, so equality should fail.");
        }
Ejemplo n.º 2
0
        public void ReferenceEqual()
        {
            var left  = new HoldemBattle.Models.Card(GameValues.Suit.Spade, GameValues.Value.Three);
            var right = (object)left;

            Assert.IsTrue(left.Equals(right), "An object and reference to the same object should pass reference equality.");
        }
Ejemplo n.º 3
0
        public void ReferenceEqualValues()
        {
            var left  = new HoldemBattle.Models.Card(GameValues.Suit.Spade, GameValues.Value.Three);
            var right = (object)new HoldemBattle.Models.Card(GameValues.Suit.Spade, GameValues.Value.Three);

            Assert.IsTrue(left.Equals(right), "The objects with different references should pass equality as they have the same values.");
        }
Ejemplo n.º 4
0
        public void MemberEqualsFail()
        {
            var left  = new HoldemBattle.Models.Card(GameValues.Suit.Spade, GameValues.Value.Three);
            var right = new HoldemBattle.Models.Card(GameValues.Suit.Spade, GameValues.Value.Two);

            Assert.IsFalse(left.Equals(right), "3 should not be equal to 2.");
        }