コード例 #1
0
ファイル: TimeMania.cs プロジェクト: OwenMcDonnell/LotteryApp
 public bool Equals(TimeMania other)
 {
     return(other != null &&
            LotteryId == other.LotteryId &&
            DateRealized == other.DateRealized &&
            Dozens.SequenceEqual(other.Dozens) &&
            Team == other.Team &&
            TotalValue == other.TotalValue &&
            TotalWinners7 == other.TotalWinners7 &&
            City == other.City &&
            UF == other.UF &&
            TotalWinners6 == other.TotalWinners6 &&
            TotalWinners5 == other.TotalWinners5 &&
            TotalWinners4 == other.TotalWinners4 &&
            TotalWinners3 == other.TotalWinners3 &&
            WinnersTeam == other.WinnersTeam &&
            TotalValueNumbers7 == other.TotalValueNumbers7 &&
            TotalValueNumbers6 == other.TotalValueNumbers6 &&
            TotalValueNumbers5 == other.TotalValueNumbers5 &&
            TotalValueNumbers4 == other.TotalValueNumbers4 &&
            TotalValueNumbers3 == other.TotalValueNumbers3 &&
            TeamValue == other.TeamValue &&
            AccumulatedValue == other.AccumulatedValue &&
            EstimatedPrize == other.EstimatedPrize);
 }
コード例 #2
0
 public bool Equals(LotoMania other)
 {
     return(other != null &&
            LotteryId == other.LotteryId &&
            DateRealized == other.DateRealized &&
            Dozens.SequenceEqual(other.Dozens) &&
            TotalValue == other.TotalValue &&
            TotalWinners20 == other.TotalWinners20 &&
            City == other.City &&
            UF == other.UF &&
            TotalWinners19 == other.TotalWinners19 &&
            TotalWinners18 == other.TotalWinners18 &&
            TotalWinners17 == other.TotalWinners17 &&
            TotalWinners16 == other.TotalWinners16 &&
            TotalWinnersNoNumbers == other.TotalWinnersNoNumbers &&
            TotalValueNumbers20 == other.TotalValueNumbers20 &&
            TotalValueNumbers19 == other.TotalValueNumbers19 &&
            TotalValueNumbers18 == other.TotalValueNumbers18 &&
            TotalValueNumbers17 == other.TotalValueNumbers17 &&
            TotalValueNumbers16 == other.TotalValueNumbers16 &&
            TotalValueNoNumbers == other.TotalValueNoNumbers &&
            Acumulated20 == other.Acumulated20 &&
            Acumulated19 == other.Acumulated19 &&
            Acumulated18 == other.Acumulated18 &&
            Acumulated17 == other.Acumulated17 &&
            Acumulated16 == other.Acumulated16 &&
            AcumulatedNoNumbers == other.AcumulatedNoNumbers &&
            PrizeEstimated == other.PrizeEstimated &&
            SpecialPrizeEstimated == other.SpecialPrizeEstimated);
 }
コード例 #3
0
    static void Main(string[] args)
    {
        Incrementer incrementer  = new Incrementer();
        Dozens      dozenCounter = new Dozens(incrementer);

        incrementer.DoCount();
        Console.WriteLine("number of dozen = {0}", dozenCounter.DozenCount);
    }
コード例 #4
0
    static void Main()
    {
        Incrementer incrementer   = new Incrementer();
        Dozens      dozensCounter = new Dozens(incrementer);

        incrementer.DoCount();
        Console.WriteLine("Number of dozens = {0}", dozensCounter.DozensCount);
    }
コード例 #5
0
    static void Main()
    {
        var    incrementer   = new Incrementer();
        Dozens dozensCounter = new Dozens(incrementer);

        incrementer.DoCount();
        Console.WriteLine(dozensCounter.DozensCount);
    }
コード例 #6
0
        public void _01()
        {
            var incrementer = new Incrementer();
            var dozens      = new Dozens(incrementer);

            incrementer.DoCount();
            Assert.Equal(9, dozens.DozensCount);
        }
コード例 #7
0
ファイル: eventHandler.cs プロジェクト: koson/WEEK-12
    static void Main(string[] args)
    {
        Incrementer incrementer  = new Incrementer();                        // สร้าง publisher
        Dozens      dozenCounter = new Dozens(incrementer);                  // สร้าง subscriber โดยระบุ publisher เป็น parameter

        incrementer.DoCount();                                               // จำลองสถานการณ์ที่ firing event
        Console.WriteLine("number of dozen = {0}", dozenCounter.DozenCount); // รายงานสรุป
    }
コード例 #8
0
ファイル: UnitTest2.cs プロジェクト: Kyou12138/CommonUtils
        public void demo3()
        {
            Incrementer incrementer = new Incrementer();
            //Dozens dozensCounter = new Dozens(incrementer);
            Dozens dozensCounter = new Dozens();

            incrementer.CoutedADozen += dozensCounter.IncrementDozensCount;
            incrementer.DoCount();
            Console.WriteLine("dozensCount:{0}", dozensCounter.DozensCount);
        }
コード例 #9
0
    static void Main()
    {
        Incrementer incrementer = new Incrementer();       // instantiate Publisher
        Dozens dozensCounter    = new Dozens(incrementer); // instantiate Subscriber

        incrementer.DoCount();                             // invoke method in Publisher, which will raise event.
        Console.WriteLine("Number of dozens = {0}",
                          dozensCounter.DozensCount);
        Console.ReadLine();
    }
コード例 #10
0
        public void GetStringTranscription_IncorrectNumber_Exception(char number, Cases caseVal, Genders genderVal)
        {
            //arrange
            var dozens = new Dozens();

            //act
            TestDelegate result = () => dozens.GetStringTranscription(number, caseVal, genderVal);

            //assert
            Assert.Throws <InvalidDataException>(result);
        }
コード例 #11
0
        public void GetStringTranscription_CorrectNumber_CorrectString(char number, string resultTest, Cases caseVal, Genders genderVal)
        {
            //arrange
            var dozens = new Dozens();

            //act
            var result = dozens.GetStringTranscription(number, caseVal, genderVal);

            //assert
            Assert.That(result, Is.EqualTo(resultTest));
        }
コード例 #12
0
ファイル: Federal.cs プロジェクト: OwenMcDonnell/LotteryApp
 public bool Equals(Federal other)
 {
     return(other != null &&
            LotteryId == other.LotteryId &&
            DateRealized == other.DateRealized &&
            Dozens.SequenceEqual(other.Dozens) &&
            Prize1 == other.Prize1 &&
            Prize2 == other.Prize2 &&
            Prize3 == other.Prize3 &&
            Prize4 == other.Prize4 &&
            Prize5 == other.Prize5);
 }
コード例 #13
0
ファイル: Loteca.cs プロジェクト: OwenMcDonnell/LotteryApp
 public bool Equals(Loteca other)
 {
     return(other != null &&
            LotteryId == other.LotteryId &&
            DateRealized == other.DateRealized &&
            Winners14 == other.Winners14 &&
            City == other.City &&
            UF == other.UF &&
            Average14 == other.Average14 &&
            IsAcumulated == other.IsAcumulated &&
            AmountValue14 == other.AmountValue14 &&
            Winners13 == other.Winners13 &&
            AmountValue13 == other.AmountValue13 &&
            Winners12 == other.Winners12 &&
            AmountValue12 == other.AmountValue12 &&
            Dozens.SequenceEqual(other.Dozens) &&
            TotalAmount == other.TotalAmount &&
            EstimatedPrize == other.EstimatedPrize);
 }
コード例 #14
0
 public bool Equals(MegaSena other)
 {
     return(other != null &&
            LotteryId == other.LotteryId &&
            DateRealized == other.DateRealized &&
            Dozens.SequenceEqual(other.Dozens) &&
            TotalCollection == other.TotalCollection &&
            Winners6Numbers == other.Winners6Numbers &&
            City == other.City &&
            UF == other.UF &&
            Average6Numbers == other.Average6Numbers &&
            Winners5Numbers == other.Winners5Numbers &&
            Average5Numbers == other.Average5Numbers &&
            Winners4Numbers == other.Winners4Numbers &&
            Average4Numbers == other.Average4Numbers &&
            IsAccumulated == other.IsAccumulated &&
            AccumulatedPrize == other.AccumulatedPrize &&
            EstimatedPrize == other.EstimatedPrize &&
            AccumulatedMegaSenaVirada == other.AccumulatedMegaSenaVirada);
 }
コード例 #15
0
 public bool Equals(Quina other)
 {
     return(other != null &&
            LotteryId == other.LotteryId &&
            DateRealized == other.DateRealized &&
            Dozens.SequenceEqual(other.Dozens) &&
            TotalAmount == other.TotalAmount &&
            Winners5 == other.Winners5 &&
            City == other.City &&
            UF == other.UF &&
            Average5Numbers == other.Average5Numbers &&
            Winners4 == other.Winners4 &&
            Average4Numbers == other.Average4Numbers &&
            Winners3 == other.Winners3 &&
            Average3Numbers == other.Average3Numbers &&
            Winners2 == other.Winners2 &&
            Average2Numbers == other.Average2Numbers &&
            IsAccumulated == other.IsAccumulated &&
            AccumulatedValue == other.AccumulatedValue &&
            EstimatePrize == other.EstimatePrize &&
            AccumulatedSorteioSaoJoao == other.AccumulatedSorteioSaoJoao);
 }
コード例 #16
0
ファイル: LotoFacil.cs プロジェクト: OwenMcDonnell/LotteryApp
 public bool Equals(LotoFacil other)
 {
     return(other != null &&
            LotteryId == other.LotteryId &&
            DateRealized == other.DateRealized &&
            Dozens.SequenceEqual(other.Dozens) &&
            TotalAmount == other.TotalAmount &&
            Winners15 == other.Winners15 &&
            City == other.City &&
            UF == other.UF &&
            Winners14 == other.Winners14 &&
            Winners13 == other.Winners13 &&
            Winners12 == other.Winners12 &&
            Winners11 == other.Winners11 &&
            AverageAmount15 == other.AverageAmount15 &&
            AverageAmount14 == other.AverageAmount14 &&
            AverageAmount13 == other.AverageAmount13 &&
            AverageAmount12 == other.AverageAmount12 &&
            AverageAmount11 == other.AverageAmount11 &&
            Accumulated15 == other.Accumulated15 &&
            EstimatedPrize == other.EstimatedPrize &&
            SpecialAmount == other.SpecialAmount);
 }
コード例 #17
0
ファイル: LotoGol.cs プロジェクト: OwenMcDonnell/LotteryApp
 public bool Equals(LotoGol other)
 {
     return(other != null &&
            LotteryId == other.LotteryId &&
            DateRealized == other.DateRealized &&
            City == other.City &&
            UF == other.UF &&
            Winners5 == other.Winners5 &&
            Average5 == other.Average5 &&
            IsAcumlated5 == other.IsAcumlated5 &&
            Acumulated5 == other.Acumulated5 &&
            Winners4 == other.Winners4 &&
            Average4 == other.Average4 &&
            IsAcumlated4 == other.IsAcumlated4 &&
            Acumulated4 == other.Acumulated4 &&
            Winners3 == other.Winners3 &&
            Average3 == other.Average3 &&
            IsAcumlated3 == other.IsAcumlated3 &&
            Acumulated3 == other.Acumulated3 &&
            Dozens.SequenceEqual(other.Dozens) &&
            TotalAmount == other.TotalAmount &&
            EstimatedPrize == other.EstimatedPrize);
 }
コード例 #18
0
        public void Play()
        {
            bool   play;
            string playAgain;

            while (play = true && Player.money > 0)
            {
                Console.Clear();
                WriteText.WriteLine("Place Your Bets!", ConsoleColor.Red);
                WriteText.WriteLine($"Choose a number cooresponding to the bet you'd like to place\n" +

                                    $"1: bet on a number(1/36 odds)\t 2: Even or Odds(1/2 odds)\t 3: Red or Black(1/2 odds)\n" +

                                    $"4: Lows or Highs(1/2 odds)\t 5: Dozens(1/3 odds)\t 6: Column bet(1/3 odds)\n" +

                                    $"7: Street(1/12 odds)\t 8: six-line(1/6 odds)\t 9: Split(1/18 odds)\n" +

                                    $"10: Corner bet(1/9 odds)", ConsoleColor.Green);
                int chosenBet = Int32.Parse(Console.ReadLine());

                //switch (chosenBet)
                //{
                //    case 1: chosenBet > 10;
                //    throw new IndexOutOfRangeException("You chose a number that dose not match any of the bets.");
                //    break;
                //}
                if (chosenBet > 10)
                {
                    throw new IndexOutOfRangeException("You chose a number that dose not match any of the bets.");
                }
                if (chosenBet == 1)
                {
                    Number number = new Number();
                    number.NumbersBet(Spin());
                }

                if (chosenBet == 2)
                {
                    EvenOrOdd evenorodd = new EvenOrOdd();
                    evenorodd.EvenOrOddBet(Spin());
                }
                if (chosenBet == 3)
                {
                    RedOrBlack redorblack = new RedOrBlack();
                    redorblack.RedOrBlackBet(Spin());
                }
                if (chosenBet == 4)
                {
                    LowsHighs loworhigh = new LowsHighs();
                    loworhigh.LowOrHighBet(Spin());
                }
                if (chosenBet == 5)
                {
                    Dozens dozens = new Dozens();
                    dozens.DozensBet(Spin());
                }
                if (chosenBet == 6)
                {
                    Columns columns = new Columns();
                    columns.ColumnBet(Spin());
                }
                if (chosenBet == 7)
                {
                    Street street = new Street();
                    street.StreetBet(Spin());
                }
                if (chosenBet == 8)
                {
                    SixLine sixLine = new SixLine();
                    sixLine.SixLineBet(Spin());
                }
                if (chosenBet == 9)
                {
                    Split split = new Split();
                    split.SplitBet(Spin());
                }
                if (chosenBet == 10)
                {
                    Corner corner = new Corner();
                    corner.CornerBet(Spin());
                }
                if (Player.money == 0)
                {
                    play = false;
                    WriteText.WriteLine("You lost all you own GET OUT!", ConsoleColor.Red);
                    Console.ReadKey();
                }
                if (Player.money > 0)
                {
                    WriteText.WriteLine("Play again? (yes/no): ", ConsoleColor.Red);
                    playAgain = Console.ReadLine();
                    playAgain.ToLower();
                    if (playAgain == "yes")
                    {
                        play = true;
                        Random random = new Random();
                        int    phrase = random.Next(1, 3);
                        if (phrase == 1)
                        {
                            WriteText.WriteLine("Its always possible to have Better luck this time.", ConsoleColor.Red);
                        }
                        if (phrase == 2)
                        {
                            WriteText.WriteLine("Play Again!? Why?", ConsoleColor.Red);
                        }
                        if (phrase == 3)
                        {
                            WriteText.WriteLine("Luck is on your side.", ConsoleColor.Red);
                            Console.ReadKey();
                        }
                    }
                }
            }
        }