Example #1
0
    public void TestParseCard7()
    {
        Card c1 = RM.RandomCard();
        Card c2 = c1.Stringify().ParseToCard();

        Assert.IsTrue(c1.IsEqualTo(c2));
    }
Example #2
0
    public void TestGameStateNotEqual1()
    {
        List <Player> players = new List <Player>();

        players.Add(RM.RandomPlayer(23, 123));
        players.Add(RM.RandomPlayer(24, 92));
        List <ProjectCard> pc = new List <ProjectCard>();

        pc.Add(new ProjectCard(RM.RandomCard(), CardDice.I));
        pc.Add(new ProjectCard(RM.RandomCard(), CardDice.II));
        pc.Add(new ProjectCard(RM.RandomCard(), CardDice.III));
        pc.Add(new ProjectCard(RM.RandomCard(), CardDice.IV));

        GameState gs1 = RM.RandomGameState(players, pc, RM.RandomBonusList(20));

        GameState gs2 = gs1.Stringify().ParseToGameState();

        if (gs2.CurrentRound == Round.A)
        {
            gs2.CurrentRound = Round.B;
        }
        else
        {
            gs2.CurrentRound = Round.A;
        }

        Assert.IsFalse(gs1.IsEqualTo(gs2));
    }
Example #3
0
    public void TestTwoProjectCardsAreNotEqual1()
    {
        var         card = RM.RandomCard();
        ProjectCard pc1  = new ProjectCard(card, CardDice.II);
        ProjectCard pc2  = new ProjectCard(card, CardDice.I);

        Assert.IsFalse(pc1.IsEqualTo(pc2));
    }
Example #4
0
    public void TestTwoProjectCardsAreNotEqual2()
    {
        var         card1 = RM.RandomCard(3);
        var         card2 = RM.RandomCard(4);
        ProjectCard pc1   = new ProjectCard(card1, CardDice.II);
        ProjectCard pc2   = new ProjectCard(card2, CardDice.II);

        Assert.IsFalse(pc1.IsEqualTo(pc2));
    }
Example #5
0
    public void TestParsingListToStringNotEqual500()
    {
        List <Card> list1 = RM.RandomList(500);
        List <Card> list2 = list1.Stringify().ParseToCardsList();

        list1.Add(RM.RandomCard());

        Assert.IsFalse(list1.IsEqualTo(list2));
    }
Example #6
0
    public void TestTwoActionsAreNotEqual3()
    {
        Card targetCard = RM.RandomCard();
        Card actionCard = RM.RandomCard();

        Models.Action a1 = new Models.Action(ActionType.BonusCastle, actionCard, targetCard, 0, 0, 0);
        Models.Action a2 = new Models.Action(ActionType.BonusCastle, actionCard, targetCard, 0, 1, 0);

        Assert.IsFalse(a1.IsEqualTo(a2));
    }
Example #7
0
    public void TestTwoActionsAreEqual1()
    {
        Card targetCard = RM.RandomCard();
        Card actionCard = RM.RandomCard();

        Models.Action a1 = new Models.Action(ActionType.BonusCarperter, actionCard, targetCard, 5, 6, 7);
        Models.Action a2 = new Models.Action(ActionType.BonusCarperter, actionCard, targetCard, 5, 6, 7);

        Assert.IsTrue(a1.IsEqualTo(a2));
    }
Example #8
0
    public void TestTwoEmptyCardListsAreNotEqual1()
    {
        List <Card> list1 = new List <Card>();
        List <Card> list2 = new List <Card>();

        for (int i = 0; i < 100; i++)
        {
            var card = RM.RandomCard();
            list1.Add(card);
        }

        Assert.IsFalse(list1.IsEqualTo(list2));
    }
Example #9
0
    public void TestGameStateEqual1()
    {
        List <Player> players = new List <Player>();

        players.Add(RM.RandomPlayer(23, 123));
        players.Add(RM.RandomPlayer(24, 92));
        List <ProjectCard> pc = new List <ProjectCard>();

        pc.Add(new ProjectCard(RM.RandomCard(), CardDice.I));
        pc.Add(new ProjectCard(RM.RandomCard(), CardDice.II));
        pc.Add(new ProjectCard(RM.RandomCard(), CardDice.III));
        pc.Add(new ProjectCard(RM.RandomCard(), CardDice.IV));

        GameState gs1 = RM.RandomGameState(players, pc, RM.RandomBonusList(20));

        GameState gs2 = gs1.Stringify().ParseToGameState();

        Assert.IsTrue(gs1.IsEqualTo(gs2));
    }