public static void Main(string[] args)
    {
        Barman    barman    = new Barman();
        Drinker   drinker   = new Drinker(barman);
        Stopwatch stopwatch = Stopwatch.StartNew();

        drinker.Drink();
        stopwatch.Stop();
        Console.WriteLine($"Took {stopwatch.ElapsedMilliseconds}");
        Console.ReadLine();
    }
Exemple #2
0
        static void Main(string[] args)
        {
            Task.Run(async() =>
            {
                Barman oBarman    = new Barman();
                Task <bool> TBool = oBarman.CalientaSnack();

                oBarman.HacerContel();

                bool boolResult = await TBool;
            }).GetAwaiter().GetResult();
        }
        public async Task Handle_Success_NoCondition()
        {
            var barman = new Barman()
            {
                Id = Guid.NewGuid().ToString()
            };
            await _dbContext.AddAsync(barman);

            await _dbContext.SaveChangesAsync();

            var claimPrincipal = new ClaimsPrincipal(new ClaimsIdentity(new []
            {
                new Claim(ClaimTypes.NameIdentifier, barman.Id)
            }));

            Assert.IsType <Barman>(await _handler.HandleAsync(claimPrincipal));

            _loggerMock.VerifyNoOtherCalls();
        }
Exemple #4
0
 public Barman HireBarman()
 {
     Barman = new Barman(this);
     SetCommand(new CloseBarCommand(Barman));
     return(Barman);
 }
Exemple #5
0
        static void Main()
        {
            Barman b1 = new Barman("Staszek", "Pientaszek", 20, 0.70);
            Barman b2 = new Barman("Johny", "Perfect", 30, 0.99);
            Barman b3 = new Barman("Andrzej", "Średni", 25, 0.80);

            Nasz_bar.DodajBarmana(b1);
            Nasz_bar.DodajBarmana(b2);
            Nasz_bar.DodajBarmana(b3);
            int i = 0;

            Console.Write("Podaj swoje imie:");
            string imie = "";

            imie = Console.ReadLine();

            Console.Write("Podaj swoje Nazwisko:");
            string Nazwisko = "";

            Nazwisko = Console.ReadLine();

            Console.Write("Podaj swój wiek:");
            int wiek;

            wiek = int.Parse(Console.ReadLine());

            Gracz.nowa_postac(imie, Nazwisko, wiek);
            Console.Clear();

            while (i != 20)
            {
                Menu();
                switch (Console.ReadLine())
                {
                case "1":
                    Nasz_bar.LosujBarmana();
                    WyborNapoju();
                    break;

                case "2":
                    Console.Clear();
                    Console.WriteLine(" Z nami się nie napijesz?");
                    Thread.Sleep(1500);
                    CzyAbyNapewno();
                    switch (Console.ReadLine())
                    {
                    case "1":
                        Console.Clear();
                        Console.WriteLine("Swój chłop!!!");
                        Thread.Sleep(1500);
                        Nasz_bar.LosujBarmana();
                        WyborNapoju();
                        break;

                    case "2":
                        Console.Clear();
                        Console.WriteLine("Wracasz na następny dzień\n");
                        break;

                    case "3":
                        if (Losuj(2) == 1)
                        {
                            Console.WriteLine("Wchodzisz do baru!!!! :)");
                            Thread.Sleep(1500);
                            Nasz_bar.LosujBarmana();
                            WyborNapoju();
                        }
                        else
                        {
                            Console.WriteLine("Pech, wychodzisz :(");
                            Thread.Sleep(1500);
                            System.Environment.Exit(0);
                        }
                        break;
                    }
                    break;

                case "3":
                    Console.Clear();
                    if (Gracz.Wiek < 18)
                    {
                        Console.WriteLine(" Jendak się skapnęli");
                        Console.WriteLine(" Wypadasz z Baru!");
                        Thread.Sleep(1500);
                        System.Environment.Exit(0);
                    }
                    else
                    {
                        Console.WriteLine("Nie żartuj sobie, Wchodzisz ;) ");
                        Thread.Sleep(1500);
                        Nasz_bar.LosujBarmana();
                        WyborNapoju();
                    }
                    break;


                case "4":
                    Console.Clear();
                    Console.WriteLine("Dostałeś Pracę: " +
                                      "\nPomoc Panoramixowi przy tworzeniu Magicznego Napoju");

                    Console.WriteLine("\nPanoramix zdradził Ci skład magicznego napoju:" +
                                      "\nJemioła, Korzenie, Homar, Czterolistna Koniczyna, Ryba" +
                                      "\nMarchew, Ropa Naftowa, Sól");

                    Console.WriteLine("\nTwoim zadaniem jest zdobyć Czterolistną Koniczynę," +
                                      "\nkupić Świeżą Rybę(Pamiętaj, byle nie u Ahigieniksa)" +
                                      "\ni pozbierać Marchew (przynajmniej 4) ");
                    Console.WriteLine("\nWciśnij klawisz kiedy będziesz gotowy");
                    Console.ReadKey();
                    Console.Clear();
Exemple #6
0
        public void SetUp()
        {
            Chief chief = new Chief();

            barman = chief.HireBarman();
        }
Exemple #7
0
        public void SetUp()
        {
            Chief chief = new Chief();

            barmanUnderTest = chief.HireBarman();
        }
 public Drinker(Barman barman)
 {
     this.barman = barman;
 }
Exemple #9
0
    static void Main()
    {
        var barman = new Barman();

        barman.HelpUserToComposeCocktail();
    }