Exemple #1
0
        public void all_list_items_not_null()
        {
            var        sc   = new Scratch_card("Name");
            List <int> list = sc.generate_rand();

            Assert.That(list, Has.All.GreaterThan(0));
        }
Exemple #2
0
        static void Main(string[] args)
        {
            var games = new IGambling[]
            {
                new Lottery("Lotto", 45, 45, 6, 1),
                new Lottery("Euromillions", 50, 12, 5, 2),
                new Lottery("Joker", 90, 0, 5, 0),
                new Scratch_card("Cash"),
                new Scratch_card("Schatztruhe")
            };

            foreach (var g in games)
            {
                g.get_instructions();
                g.print_list(g.generate_rand(), g.Name);
            }

            var sc = new Scratch_card("Lebenlang");

            sc.play();
            sc.play();
            sc.play();


            Json.Serialization(games);
        }
Exemple #3
0
        public void is_different_balance_after_game()
        {
            var     sc           = new Scratch_card("Name");
            decimal init_balance = sc.balance;

            sc.play();
            decimal new_balance = sc.balance;

            Assert.AreNotEqual(init_balance, new_balance);
        }
Exemple #4
0
        public void sum_no_more_than_three_times()
        {
            var        sc   = new Scratch_card("Name");
            List <int> list = sc.generate_rand();

            var gbi = list.GroupBy(i => i);

            foreach (var grp in gbi)
            {
                Assert.That(grp.Count(), Is.LessThanOrEqualTo(3));
            }
        }
Exemple #5
0
        static void Main(string[] args)
        {
            try
            {
                var game1 = new Lottery("Lotto", 45, 45, 6, 1);
                var game2 = new Lottery("Euromillions", 50, 12, 5, 2);
                var game3 = new Lottery("Joker", 90, 0, 5, 0);
                var game4 = new Scratch_card("Cash");

                IGambling[] games = new IGambling[] { game1, game2, game3, game4 };

                foreach (var g in games)
                {
                    g.get_instructions();
                    g.print_list(g.generate_rand(), g.Name);
                }
            }
            catch (ArgumentException ex)
            {
                Console.WriteLine(ex.Message);
            }
        }
Exemple #6
0
        public void is_the_same_type()
        {
            IGambling sc = new Scratch_card("Name");

            Assert.IsTrue(sc.GetType().Equals(typeof(Scratch_card)));
        }