Пример #1
0
 public void can_save()
 {
     var x =
         new Sitzung(
             new Spiel(
                 new Normalschein().quick()
                 , new Normalschein( new Normalfeld( 1, 2, 3, 4, 5, 6), new Normalfeld(1, 1, 2, 3, 4, 5, 6))
                 ));
     sut.Save(x);
     sut.CommitTransactionAndFlush();
     Assert.IsTrue(x.Id > 0);
 }
Пример #2
0
 public void can_display_evaluationResult()
 {
     var a = new Ausspielung(new[] { 1, 2, 3, 4, 5, 6 }, 49, "1234567", "123456", 7);
     var s = new Sitzung(
         new Spiel(
             new Normalschein(
                 new Normalfeld(1, 2, 3, 4, 5, 6)) { IsSpiel77 = true, Losnummer = "1234567" }));
     IEvaluationResult e = new EvaluationResult(s, a);
     Assert.That(e.Protocols.Count(), Is.EqualTo(2));
     string result = e.display();
     Console.WriteLine(result);
 }
Пример #3
0
        public void merge_random_ISitzung()
        {
            var aus = new Ausspielung(new[] { 1, 2, 3, 4, 5, 6 }, 49, "1234567", "123456", 7);

            ISitzung s = new Sitzung(
                new Spiel(
             new Normalschein(new Normalfeld(1, 2, 3, 4, 5, 6)){Losnummer = "1234567"},
             new Normalschein(new Normalfeld(1, 2, 3, 4, 5, 6)),
             new Normalschein(new Normalfeld(1, 2, 3, 4, 5, 49)),
             new Normalschein(new Normalfeld(1, 2, 3, 4, 5, 7)),
             new Normalschein(new Normalfeld(1, 2, 3, 4, 7, 49)),
             new Normalschein(new Normalfeld(1, 2, 3, 4, 7, 8)),
             new Normalschein(new Normalfeld(1, 2, 3, 9, 7, 49)),
             new Normalschein(new Normalfeld(1, 2, 3, 9, 7, 8)),
             new Normalschein(new Normalfeld(10,11,12, 9, 7, 8)),
             new Normalschein(new Normalfeld(10, 11, 12, 9, 7, 8)) { IsSpiel77 = true, Losnummer = "1234567" },
             new Normalschein(new Normalfeld(10, 11, 12, 9, 7, 8)) { IsSpiel77 = true, Losnummer = "0234567" },
             new Normalschein(new Normalfeld(10, 11, 12, 9, 7, 8)) { IsSpiel77 = true, Losnummer = "0034567" },
             new Normalschein(new Normalfeld(10, 11, 12, 9, 7, 8)) { IsSpiel77 = true, Losnummer = "0004567" },
             new Normalschein(new Normalfeld(10, 11, 12, 9, 7, 8)) { IsSpiel77 = true, Losnummer = "0000567" },
             new Normalschein(new Normalfeld(10, 11, 12, 9, 7, 8)) { IsSpiel77 = true, Losnummer = "0000067" },
             new Normalschein(new Normalfeld(10, 11, 12, 9, 7, 8)) { IsSpiel77 = true, Losnummer = "0000007" },
             new Normalschein(new Normalfeld(10, 11, 12, 9, 7, 8)) { IsSuper6 = true, Losnummer = "0123456" },
             new Normalschein(new Normalfeld(10, 11, 12, 9, 7, 8)) { IsSuper6 = true, Losnummer = "0023456" },
             new Normalschein(new Normalfeld(10, 11, 12, 9, 7, 8)) { IsSuper6 = true, Losnummer = "0003456" },
             new Normalschein(new Normalfeld(10, 11, 12, 9, 7, 8)) { IsSuper6 = true, Losnummer = "0000456" },
             new Normalschein(new Normalfeld(10, 11, 12, 9, 7, 8)) { IsSuper6 = true, Losnummer = "0000056" },
             new Normalschein(new Normalfeld(10, 11, 12, 9, 7, 8)) { IsSuper6 = true, Losnummer = "0000006" }
                     ));

            Console.WriteLine("Ziehung: " + Stringifier.stringify(aus.Gewinnzahlen, " "));
            foreach (var auftrag in s.Auftraege)
                foreach (var tipp in auftrag.Tipps)
                    Console.WriteLine("Tipp: " + Stringifier.stringify(tipp.Tipp.Tippzahlen, " "));
            var p = s.evaluate(aus);
            if (s.IsWin(aus))
                Console.WriteLine("won");
            else
                Console.WriteLine("lost");

            foreach (var protocol in p) {
                Console.WriteLine(protocol.ProtocolType);
                foreach (var hit in protocol.Hits.OrderBy(x => x.Key))
                    Console.WriteLine("Hits: " + "Gk" + hit.Key + ": " + hit.Value);
            }
        }
Пример #4
0
        public void merge_random_ISitzung()
        {
            ISitzung s = new Sitzung(new Spiel(
                new Normalschein().quick(),
                new Systemschein().quick()
                ));
            var aus = new Ausspielung();

            Console.WriteLine("Ziehung: " + Stringifier.stringify(aus.Gewinnzahlen, " "));
            foreach (var auftrag in s.Auftraege)
                foreach (var tipp in auftrag.Tipps)
                    Console.WriteLine("Tipp: " + Stringifier.stringify(tipp.Tipp.Tippzahlen, " "));

            var p = s.evaluateLotto(aus);
            if (p.IsWin)
                Console.WriteLine("won");
            else
                Console.WriteLine("lost");
            foreach (var hit in p.Hits.OrderBy(x => x.Key))
                Console.WriteLine("Hits: " + "Gk" + hit.Key + ": " + hit.Value);
        }
Пример #5
0
        public void merge_Sitzung()
        {
            ISitzung s = new Sitzung(
                new Spiel(
                    new Systemschein(
                        new Systemfeld(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13){SID = 13})));
            var aus = new Ausspielung(new[] { 11,12,13,14,15,16 }, 49, "1234567", "234567", 7);

            Console.WriteLine("Ziehung: " + Stringifier.stringify(aus.Gewinnzahlen, " "));
            foreach (var auftrag in s.Auftraege)
                foreach (var tipp in auftrag.Tipps)
                    Console.WriteLine("Tipp: " + Stringifier.stringify(tipp.Tipp.Tippzahlen, " "));
            var p = s.evaluate(aus);

            if (s.IsWin(aus))
                Console.WriteLine("won");
            else
                Console.WriteLine("lost");

            foreach (var protocol in p) {
                Console.WriteLine("Protocol: " + protocol.ProtocolType);
                foreach (var hit in protocol.Hits.OrderBy(x => x.Key))
                    Console.WriteLine("Hits: " + "Gk" + hit.Key + ": " + hit.Value);
            }

            var foo = new EvaluationService(aus).evaluate(s.toSpiel());
        }