public void TestFindingNotCompletedTripleCards2()
    {
        Player player = RandomModels.RandomPlayer(10, 20, 30);

        player.CompletedProjects.Clear();

        player.CompletedProjects.Add(new Card(CardClass.ActionCastle, CardDice.I, 0, 1));
        player.CompletedProjects.Add(new Card(CardClass.ActionCastle, CardDice.I, 0, 1));
        player.CompletedProjects.Add(new Card(CardClass.ActionCastle, CardDice.I, 0, 1));
        player.CompletedProjects.Add(new Card(CardClass.ActionCastle, CardDice.I, 0, 3));
        player.CompletedProjects.Add(new Card(CardClass.ActionCastle, CardDice.I, 0, 3));

        Assert.AreEqual(1, player.GetNotCompletedTriples().Count);
    }
Example #2
0
    public void TestGameStateEqual2()
    {
        List <Player> players = new List <Player>();

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

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

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

        Assert.IsTrue(gs1.IsEqualTo(gs2));
    }
Example #3
0
    public void TestGetNotCompletedTriplesForCard14()
    {
        Player player            = RandomModels.RandomPlayer(12, 20, 30);
        var    completedProjects = player.CompletedProjects;

        completedProjects.Clear();
        completedProjects.Add(new Card(CardClass.ActionCastle, CardDice.O, 0, 1));
        completedProjects.Add(new Card(CardClass.ActionCastle, CardDice.O, 0, 1));
        completedProjects.Add(new Card(CardClass.ActionCastle, CardDice.O, 0, 2));
        completedProjects.Add(new Card(CardClass.ActionCastle, CardDice.O, 0, 2));
        completedProjects.Add(new Card(CardClass.ActionCastle, CardDice.O, 0, 3));
        completedProjects.Add(new Card(CardClass.ActionCastle, CardDice.O, 0, 3));

        var result = player.GetNotCompletedTriplesForCard(new Card(CardClass.ActionMine));

        Assert.AreEqual(0, result.Count);
    }
Example #4
0
    public void TestGetNotCompletedTriplesForCard7()
    {
        Player player            = RandomModels.RandomPlayer(12, 20, 30);
        var    completedProjects = player.CompletedProjects;

        completedProjects.Clear();
        completedProjects.Add(new Card(CardClass.ActionBoardinghouse, CardDice.O, 0, 3));
        completedProjects.Add(new Card(CardClass.ActionCityHall, CardDice.O, 0, 3));
        completedProjects.Add(new Card(CardClass.ActionBank, CardDice.O, 0, 5));
        completedProjects.Add(new Card(CardClass.ActionBank, CardDice.O, 0, 5));

        var result = player.GetNotCompletedTriplesForCard(new Card(CardClass.ActionBank));

        Assert.IsTrue(result.Count == 2);
        Assert.IsTrue(result[0][0].TripleId == 3);
        Assert.IsTrue(result[1][0].TripleId == 5);
    }
Example #5
0
    public void TestGetNotCompletedTriplesForCard5()
    {
        Player player            = RandomModels.RandomPlayer(12, 20, 30);
        var    completedProjects = player.CompletedProjects;

        completedProjects.Clear();
        completedProjects.Add(new Card(CardClass.ActionMine, CardDice.O, 0, 3));
        completedProjects.Add(new Card(CardClass.ActionMine, CardDice.O, 0, 3));
        completedProjects.Add(new Card(CardClass.ActionBank, CardDice.O, 0, 5));
        completedProjects.Add(new Card(CardClass.ActionBank, CardDice.O, 0, 5));
        completedProjects.Add(new Card(CardClass.ActionBank, CardDice.O, 0, 5));

        var result = player.GetNotCompletedTriplesForCard(new Card(CardClass.ActionCloister));

        Assert.IsTrue(result.Count == 1);
        Assert.IsTrue(result[0][0].TripleId == 3);
    }
Example #6
0
    public void TestGetNotCompletedTriplesForCard2()
    {
        Player player            = RandomModels.RandomPlayer(12, 20, 30);
        var    completedProjects = player.CompletedProjects;

        completedProjects.Clear();
        completedProjects.Add(new Card(CardClass.ActionBank, CardDice.O, 0, 1));
        completedProjects.Add(new Card(CardClass.ActionBank, CardDice.O, 0, 1));
        completedProjects.Add(new Card(CardClass.ActionBank, CardDice.O, 0, 1));
        completedProjects.Add(new Card(CardClass.ActionBank, CardDice.O, 0, 2));
        completedProjects.Add(new Card(CardClass.ActionBank, CardDice.O, 0, 2));
        completedProjects.Add(new Card(CardClass.ActionBank, CardDice.O, 0, 2));

        var result = player.GetNotCompletedTriplesForCard(new Card(CardClass.ActionBank));

        Assert.IsTrue(result.Count == 0);
    }
Example #7
0
    public void TestGameStateNotEqual7()
    {
        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();

        gs2.AvailableBonusCards.Clear();

        Assert.IsFalse(gs1.IsEqualTo(gs2));
    }
Example #8
0
    public void TestGetNotCompletedTriplesForCard8()
    {
        Player player            = RandomModels.RandomPlayer(12, 20, 30);
        var    completedProjects = player.CompletedProjects;

        completedProjects.Clear();
        completedProjects.Add(new Card(CardClass.ActionCastle, CardDice.O, 0, 1));
        completedProjects.Add(new Card(CardClass.ActionCastle, CardDice.O, 0, 1));
        completedProjects.Add(new Card(CardClass.ActionCastle, CardDice.O, 0, 1));
        completedProjects.Add(new Card(CardClass.ActionCastle, CardDice.O, 0, 2));
        completedProjects.Add(new Card(CardClass.ActionCastle, CardDice.O, 0, 2));
        completedProjects.Add(new Card(CardClass.ActionCastle, CardDice.O, 0, 2));
        completedProjects.Add(new Card(CardClass.ActionCastle, CardDice.O, 0, 3));
        completedProjects.Add(new Card(CardClass.ActionCastle, CardDice.O, 0, 3));
        completedProjects.Add(new Card(CardClass.ActionCastle, CardDice.O, 0, 3));
        completedProjects.Add(new Card(CardClass.ActionCastle, CardDice.O, 0, 4));
        completedProjects.Add(new Card(CardClass.ActionCastle, CardDice.O, 0, 4));

        var result = player.GetNotCompletedTriplesForCard(new Card(CardClass.ActionCastle));

        Assert.IsTrue(result.Count == 1);
        Assert.IsTrue(result[0][0].TripleId == 4);
    }
Example #9
0
    public void TestPlayerEquals4()
    {
        Player p1 = RM.RandomPlayer(0, 0);

        Assert.IsTrue(p1.IsEqualTo(p1));
    }