示例#1
0
        public void TestSorting()
        {
            var init = _repo.CreateCards(20);
            var copy = new TravelCard[init.Length];

            Array.Copy(init, copy, init.Length);

            CardHelpers.ShuffleCards(copy);

            CardHelpers.OrderCards(copy);

            CollectionAssert.AreEqual(init, copy);
        }
示例#2
0
        private Queue <CommunityCard> LoadCommunityCards()
        {
            var CardsArr = new[]
            {
                new CommunityCard("Your HDD burnt - you lose $150", CardType.Lose, 150),
                new CommunityCard("Your RAM burnt - you lose $100", CardType.Lose, 100),
                new CommunityCard("You get a raise - you win $150", CardType.Win, 150),
                new CommunityCard("You receive 2GB RAM - you win $100", CardType.Win, 100),
                new CommunityCard("Your laptop computer crashed - you lose $50", CardType.Lose, 50),
                new CommunityCard("You spill coffe on your keyboard - you lose $20", CardType.Lose, 20),
                new CommunityCard("Your dog ate you laptop computer recharger - you lose $75", CardType.Lose, 75),
                new CommunityCard("You receive a new battery for your laptop computer - you win $75", CardType.Win, 75),
                new CommunityCard("A gift! - new smartphone for you - you win $50", CardType.Win, 50),
                new CommunityCard("You have a birthday! - you win $20", CardType.Win, 20),
            };

            return(CardHelpers.ShuffleCards(CardsArr));
        }
示例#3
0
        private Queue <ChanceCard> LoadChanceCards()
        {
            var CardsArr = new[]
            {
                new ChanceCard("Destributed Dental System Attack - you lose $150", CardType.Lose, 150),
                new ChanceCard("Ouch - Heartbleed - you lose $100", CardType.Lose, 100),
                new ChanceCard("You used float insted of decimal - you lose $50", CardType.Lose, 50),
                new ChanceCard("Your Visual Studio license expired - you lose $75", CardType.Lose, 75),
                new ChanceCard("Blue Screen of Death!!! - you lose $20", CardType.Lose, 20),
                new ChanceCard("A flush of inspiration - your code compiled without any errors! - you win $100", CardType.Win, 100),
                new ChanceCard("You fixed a nasty bug - you win $50", CardType.Win, 50),
                new ChanceCard("You received a Telerik Academy Ninja Certificate - you win $150", CardType.Win, 150),
                new ChanceCard("Internet Explorer has extincted! - you win $75", CardType.Win, 75),
                new ChanceCard("Intenet boost! - you win $20", CardType.Win, 20),
            };

            return(CardHelpers.ShuffleCards(CardsArr));
        }