public void BinaryDeserialize_ConvertedHandWithInitializedPlayer_ReturnsSameHand()
        {
            var convertedHand = InitializeConvertedHandWithSomeValidValues();

            convertedHand.AddPlayer(ConvertedFactory.InitializeConvertedPokerPlayerWithSomeValidValues());
            Affirm.That(convertedHand.BinaryDeserializedInMemory()).IsEqualTo(convertedHand);
        }
        public void BinaryDeserialized_SerializedPlayerWithSequence_ReturnsSamePlayer()
        {
            DecapsulatedConvertedPlayer player = ConvertedFactory.InitializeConvertedPokerPlayerWithSomeValidValues();

            player.SequenceStrings = new[] { "some", "someMore" };

            Affirm.That(player.BinaryDeserializedInMemory()).IsEqualTo(player);
        }
        public void BinaryDeserialized_SerializedPlayerWithOneEmptyRound_ReturnsSamePlayer()
        {
            DecapsulatedConvertedPlayer player = ConvertedFactory.InitializeConvertedPokerPlayerWithSomeValidValues();

            player.Add(new ConvertedPokerRound());

            Affirm.That(player.BinaryDeserializedInMemory()).IsEqualTo(player);
        }
        public void BinaryDeserialized_SerializedPlayerWithMBefore_ReturnsSamePlayer()
        {
            DecapsulatedConvertedPlayer player = ConvertedFactory.InitializeConvertedPokerPlayerWithSomeValidValues();

            player.MBefore = _stub.Some(20);

            Affirm.That(player.BinaryDeserializedInMemory()).IsEqualTo(player);
        }
        public void BinaryDeserialized_SerializedPlayerWithInPosition_ReturnsSamePlayer()
        {
            DecapsulatedConvertedPlayer player = ConvertedFactory.InitializeConvertedPokerPlayerWithSomeValidValues();

            player.InPosition = new bool?[] { true, false, true };

            Affirm.That(player.BinaryDeserializedInMemory()).IsEqualTo(player);
        }
        public void BinaryDeserialized_SerializedPlayerWithStrategicPosition_SerializesIt()
        {
            DecapsulatedConvertedPlayer player = ConvertedFactory.InitializeConvertedPokerPlayerWithSomeValidValues();

            player.StrategicPosition = _stub.Some(StrategicPositions.BU);

            Assert.That(
                player.BinaryDeserializedInMemory().StrategicPosition,
                Is.EqualTo(player.StrategicPosition));
        }
        public void BinaryDeserialized_SerializedPlayerWithMAfter_SerializesIt()
        {
            DecapsulatedConvertedPlayer player = ConvertedFactory.InitializeConvertedPokerPlayerWithSomeValidValues();

            player.MAfter = _stub.Some(20);

            Assert.That(
                player.BinaryDeserializedInMemory().MAfter,
                Is.EqualTo(player.MAfter));
        }
        public void BinaryDeserialized_PreflopRaiseInFrontPositionIsNonSerialized_DoesNotSerializeIt()
        {
            DecapsulatedConvertedPlayer player = ConvertedFactory.InitializeConvertedPokerPlayerWithSomeValidValues();

            player.PreflopRaiseInFrontPos = _stub.Some(1);

            Assert.That(
                player.BinaryDeserializedInMemory().PreflopRaiseInFrontPos,
                Is.Not.EqualTo(player.PreflopRaiseInFrontPos));
        }
        public void BinaryDeserialized_SerializedPlayerWithTwoNonEmptyRounds_ReturnsSamePlayer()
        {
            DecapsulatedConvertedPlayer player = ConvertedFactory.InitializeConvertedPokerPlayerWithSomeValidValues();

            player.Add(
                new ConvertedPokerRound()
                .Add(new ConvertedPokerAction(ActionTypes.R, 2.0))
                .Add(new ConvertedPokerAction(ActionTypes.C, 1.0)));

            Affirm.That(player.BinaryDeserializedInMemory()).IsEqualTo(player);
        }
        public void AffirmIsNotEqualTo_HandsWithDifferentPlayersAreEqual_Passes()
        {
            var player1 = ConvertedFactory.InitializeConvertedPokerPlayerWithSomeValidValues();

            player1.Name = "player1";
            var player2 = ConvertedFactory.InitializeConvertedPokerPlayerWithSomeValidValues();

            player2.Name = player1.Name + "difference";

            var hand1 = InitializeConvertedHandWithSomeValidValues()
                        .AddPlayer(player1);
            var hand2 = InitializeConvertedHandWithSomeValidValues()
                        .AddPlayer(player2);

            Affirm.That(hand1).IsNotEqualTo(hand2);
        }