コード例 #1
0
 public void Dishwasher_reports_clean_if_only_clean_items_are_added()
 {
     Dishwasher washer = new Dishwasher();
     washer.Load(new Fork());
     washer.Load(new Spoon());
     Assert.IsTrue(washer.ContentsAreClean());
 }
コード例 #2
0
 public void Cannot_eat_with_an_item_while_it_is_in_the_dishwasher()
 {
     Dishwasher washer = new Dishwasher();
     Spoon spoon = new Spoon();
     washer.Load(spoon);
     Avatar avatar = new Avatar();
     avatar.Eat(new IceCream()).With(spoon);
 }
コード例 #3
0
 public void Cannot_pick_up_an_item_while_it_is_locked_in_the_dishwasher()
 {
     Dishwasher washer = new Dishwasher();
     Spoon spoon = new Spoon();
     washer.Load(spoon);
     washer.Lock();
     Avatar avatar = new Avatar();
     avatar.PickUp(spoon);
 }
コード例 #4
0
ファイル: Plunger.cs プロジェクト: pirmin6/RtrCsharp
        public Plunger(Desk kitchenDesk, DirtyDishesStock stockVaisselleSale, DishesStock stockVaisselle, Dishwasher laveVaisselle, LaundryMachine laveLinge, Sink kitchenSink)
        {
            this.kitchenDesk        = kitchenDesk;
            this.stockVaisselleSale = stockVaisselleSale;
            this.stockVaisselle     = stockVaisselle;
            this.laveVaisselle      = laveVaisselle;
            this.laveLinge          = laveLinge;
            this.kitchenSink        = kitchenSink;

            sprite = new Sprite(image, xPositionInit, yPositionInit, widthInit, heightInit);
        }
コード例 #5
0
ファイル: Program.cs プロジェクト: VolffS/teststruct
        static void Main(string[] args)
        {
            Random rand = new Random();
            Arr    arr  = new Arr(5);

            arr.insert(1, 2);
            DateTime  time = DateTime.Now;
            Lst <int> l    = new Lst <int>();

            for (int i = 0; i < 5; i++)
            {
                l.insertToStart(i);
                arr.insert(i);
            }
            l.update(4, 55);


            Console.WriteLine("TIme :" + (DateTime.Now - time));
            Queue <int> stak  = new Queue <int>();
            Table       table = new Table();



            Worker       pizzaMaker   = new PizzaMaker("Gleb");
            Worker       disshwasher  = new Dishwasher("OLEG");
            PizzeriaRest pizzeriaRest = new PizzeriaRest();

            pizzeriaRest.AddWorker(pizzaMaker);
            pizzeriaRest.AddWorker(disshwasher);

            var ord1 = new Order();

            ord1.AddPizza(new Pizza("Вкусная", 3, 15));
            ord1.AddPizza(new Pizza("Нажористая", 5, 18));
            pizzeriaRest.pizzaOrders.insertToStart(ord1);
            Order ord2 = new Order();

            ord2.AddPizza(new Pizza("Вкусная", 3, 15));
            ord2.AddPizza(new Pizza("Вкусная", 3, 15));
            ord2.AddPizza(new Pizza("Вкусная", 3, 15));
            ord2.AddPizza(new Pizza("Вкусная", 3, 15));
            pizzeriaRest.pizzaOrders.insertToStart(ord2);
            while (true)
            {
                pizzeriaRest.Work();
                Thread.Sleep(1000);
                Console.Clear();
            }
        }
コード例 #6
0
    void OnSceneGUI()
    {
        Dishwasher d = (Dishwasher)target;

        d.distanceThreshold = d.transform.position.x - Handles.Slider(new Vector3(d.transform.position.x - d.distanceThreshold, d.transform.position.y, d.transform.position.z), -Vector3.right, 0.5f, Handles.CubeCap, 0.0f).x;

        Handles.BeginGUI();
        GUI.Box(HandleUtility.WorldPointToSizedRect(d.transform.position - Vector3.right * d.distanceThreshold, new GUIContent("Trigger"), GUI.skin.label), "Trigger");
        Handles.EndGUI();

        if (GUI.changed)
        {
            EditorUtility.SetDirty(target);
        }
    }
コード例 #7
0
        public void Contents_of_an_emptied_dishwasher_are_always_clean()
        {
            var fork = new Fork();
            var spoon = new Spoon();
            var glass = new Glass();

            Avatar avatar = new Avatar();
            avatar.PickUp(fork);
            avatar.PickUp(spoon);
            avatar.PickUp(glass);

            Dishwasher washer = new Dishwasher();
            washer.Load(fork);
            washer.Load(spoon);
            washer.Load(glass);
            washer.TakeEverythingOut();
            Assert.IsTrue(washer.ContentsAreClean());
        }
コード例 #8
0
 /// <summary>
 /// Saves the state of a given domain entity object
 /// </summary>
 /// <param name="entity">The entity to save</param>
 public void Persist(Dishwasher entity)
 {
     throw new System.NotImplementedException();
 }
コード例 #9
0
ファイル: KitchenModel.cs プロジェクト: pirmin6/RtrCsharp
        public KitchenModel()
        {
            personnel = new List <Sprite>();
            objects   = new List <Sprite>();

            Desk                 kitchenDesk            = new Desk();
            Sink                 kitchenSink            = new Sink();
            HeatingPlate         plaque1                = new HeatingPlate();
            HeatingPlate         plaque2                = new HeatingPlate();
            HeatingPlate         plaque3                = new HeatingPlate();
            Dishwasher           laveVaisselle          = new Dishwasher();
            LaundryMachine       laveLinge              = new LaundryMachine();
            DishesStock          stockVaisselle         = new DishesStock();
            DirtyDishesStock     stockVaiselleSale      = new DirtyDishesStock();
            Fridge               kitchenFridge          = new Fridge();
            KitchenMaterialStock kitchenMaterialStock   = new KitchenMaterialStock();
            IngredientStock      kitchenIngredientStock = new IngredientStock();

            objects.Add(kitchenDesk.Sprite);
            objects.Add(kitchenSink.Sprite);
            objects.Add(plaque1.Sprite);
            objects.Add(plaque2.Sprite);
            objects.Add(plaque3.Sprite);
            objects.Add(laveVaisselle.Sprite);
            objects.Add(laveLinge.Sprite);
            objects.Add(stockVaisselle.Sprite);
            objects.Add(stockVaiselleSale.Sprite);
            objects.Add(kitchenFridge.Sprite);
            objects.Add(kitchenMaterialStock.Sprite);
            objects.Add(kitchenIngredientStock.Sprite);


            Plunger plongeur   = new Plunger(kitchenDesk, stockVaiselleSale, stockVaisselle, laveVaisselle, laveLinge, kitchenSink);
            Clerk   commis1    = new Clerk(kitchenMaterialStock, kitchenIngredientStock, kitchenFridge, kitchenSink, "GabinCuisto");
            Clerk   commis2    = new Clerk(kitchenMaterialStock, kitchenIngredientStock, kitchenFridge, kitchenSink, "MaxCuisto");
            Cooker  cuisinier1 = new Cooker(commis1, commis2, kitchenMaterialStock, kitchenIngredientStock, kitchenFridge, "BenjaminCuisto");
            Cooker  cuisinier2 = new Cooker(commis1, commis2, kitchenMaterialStock, kitchenIngredientStock, kitchenFridge, "PirminCuisto");
            Chef    chef       = new Chef(cuisinier1, cuisinier2, kitchenDesk);


            personnel.Add(chef.Sprite);
            personnel.Add(cuisinier1.Sprite);
            personnel.Add(cuisinier2.Sprite);
            personnel.Add(commis1.Sprite);
            personnel.Add(commis2.Sprite);
            personnel.Add(plongeur.Sprite);


            socket = new SocketApp();

            SocketListener.kitchenDesk = kitchenDesk;

            // Ajouter des abonnés observer à l'observable Comptoir
            kitchenDesk.AttachChef(chef);
            kitchenDesk.AttachPlunger(plongeur);
            kitchenDesk.AttachSocket(socket);



            //// Créations des Ingrédients
            //Ingredient steak = new Ingredient("Steak", "Viande");
            //Ingredient poulet = new Ingredient("Poulet", "Viande");
            //Ingredient poisson = new Ingredient("Poisson", "Poisson");
            //Ingredient pain = new Ingredient("Pain", "Pain");
            //Ingredient salade = new Ingredient("Salade", "Vegetables");
            //Ingredient tomate = new Ingredient("Tomate", "Vegetables");
            //Ingredient oignon = new Ingredient("Oignon", "Vegetables");
            //Ingredient cheddar = new Ingredient("Cheddar", "Frommage");
            //Ingredient raclette = new Ingredient("Raclette", "Fromage");
            //Ingredient sauce = new Ingredient("Sauce", "Sauce");

            //// Instanciation Object Cuisine Material
            //KitchenKnife kitchenKnife = new KitchenKnife();
            //Pans kitchenCasserolle = new Pans();
            //Stove kitchenPoêle = new Stove();
            //WoodenSpoon kitchenCuillière = new WoodenSpoon();
            //SaladBowl kitchenBolSalade = new SaladBowl();


            //// Creation des etapes des recettes
            //RecipeStep prepareSteak = new RecipeStep("Cuire le Steak", 10);
            //prepareSteak.IngredientQuantities.Add(new IngredientQuantity(1, steak));
            //prepareSteak.ListUstencils.Add(kitchenPoêle);

            //RecipeStep preparePoulet = new RecipeStep("Cuire le Poulet", 10);
            //preparePoulet.IngredientQuantities.Add(new IngredientQuantity(1, poulet));
            //preparePoulet.ListUstencils.Add(kitchenPoêle);

            //RecipeStep preparePoisson = new RecipeStep("Cuire le Poisson", 10);
            //preparePoisson.IngredientQuantities.Add(new IngredientQuantity(1, poisson));
            //preparePoisson.ListUstencils.Add(kitchenPoêle);

            //RecipeStep prepareVegetables = new RecipeStep("Preparer les légumes", 5);
            //prepareVegetables.IngredientQuantities.Add(new IngredientQuantity(1, salade));
            //prepareVegetables.IngredientQuantities.Add(new IngredientQuantity(2, tomate));
            //prepareVegetables.IngredientQuantities.Add(new IngredientQuantity(1, oignon));
            //prepareVegetables.ListUstencils.Add(kitchenBolSalade);
            //prepareVegetables.ListUstencils.Add(kitchenCuillière);
            //prepareVegetables.ListUstencils.Add(kitchenKnife);

            //RecipeStep prepareRaclette = new RecipeStep("Préparer le frommage à Raclette", 5);
            //prepareRaclette.IngredientQuantities.Add(new IngredientQuantity(2, raclette));
            //prepareRaclette.ListUstencils.Add(kitchenKnife);

            //RecipeStep prepareCheddar = new RecipeStep("Préparer le Cheddar", 5);
            //prepareCheddar.IngredientQuantities.Add(new IngredientQuantity(2, cheddar));
            //prepareCheddar.ListUstencils.Add(kitchenKnife);

            //RecipeStep assemblerBurger = new RecipeStep("Assembler le Burger", 5);
            //assemblerBurger.IngredientQuantities.Add(new IngredientQuantity(1, pain));
            //assemblerBurger.IngredientQuantities.Add(new IngredientQuantity(1, sauce));


            //// Creations des plats
            //Dish burgerClassic = new Dish(1, "Burger Classique");
            //burgerClassic.Recipe.Add(prepareSteak);
            //burgerClassic.Recipe.Add(prepareVegetables);
            //burgerClassic.Recipe.Add(prepareCheddar);
            //burgerClassic.Recipe.Add(assemblerBurger);

            //Dish burgerChicken = new Dish(2, "Burger Poulet");
            //burgerChicken.Recipe.Add(preparePoulet);
            //burgerChicken.Recipe.Add(prepareVegetables);
            //burgerChicken.Recipe.Add(prepareCheddar);
            //burgerChicken.Recipe.Add(assemblerBurger);

            //Dish burgerMountain = new Dish(3, "Burger Montagnard");
            //burgerMountain.Recipe.Add(prepareSteak);
            //burgerMountain.Recipe.Add(prepareVegetables);
            //burgerMountain.Recipe.Add(prepareCheddar);
            //burgerMountain.Recipe.Add(assemblerBurger);

            //Dish burgerVegan = new Dish(4, "Burger Vegan");
            //burgerVegan.Recipe.Add(preparePoisson);
            //burgerVegan.Recipe.Add(prepareVegetables);
            //burgerVegan.Recipe.Add(prepareCheddar);
            //burgerVegan.Recipe.Add(prepareRaclette);
            //burgerVegan.Recipe.Add(assemblerBurger);

            DomainApp domainApp = new DomainApp();

            Console.WriteLine("Instanciation du Controller sans problèmes");
        }
コード例 #10
0
ファイル: Form1.cs プロジェクト: VolffS/teststruct
 private void Disshwasher_Onwashing(Dishwasher dishwasher)
 {
     //Console.WriteLine("Тарелка моется");
     DiswasherWork    = "Тарелка моется";
     DiswasherWorkImg = Application.StartupPath + "\\Pictures" + "\\Dishwasher.jpg";
 }
コード例 #11
0
ファイル: Form1.cs プロジェクト: VolffS/teststruct
 private void Disshwasher_Endwashing(Dishwasher dishwasher)
 {
     //Console.WriteLine("Тарелка помылась");
     DiswasherWork    = "Тарелка помылась";
     DiswasherWorkImg = Application.StartupPath + "\\Pictures" + "\\Shlapa.jpg";
 }
コード例 #12
0
 public void Ensure_that_containers_loaded_into_the_dishwasher_are_empty_first()
 {
     Avatar avatar = new Avatar();
     BaconSlab bacon = new BaconSlab();
     avatar.PickUp(bacon);
     Dishwasher washer = new Dishwasher();
     Plate plate = new Plate();
     avatar.Put(bacon).In(plate);
     washer.Load(plate);
 }
コード例 #13
0
 public void Ensure_that_we_cannot_add_an_item_to_the_dishwasher_that_is_too_big_to_fit()
 {
     Dishwasher washer = new Dishwasher();
     washer.Load(new Elephant());
 }
コード例 #14
0
 public void Contents_of_a_new_dishwasher_are_always_clean()
 {
     Dishwasher washer = new Dishwasher();
     Assert.IsTrue(washer.ContentsAreClean());
 }
コード例 #15
0
 public void Cannot_unlock_the_dishwasher_if_it_is_already_unlocked()
 {
     Dishwasher washer = new Dishwasher();
     washer.Unlock();
 }
コード例 #16
0
 public void Ensure_that_you_cannot_load_containers_that_are_not_safe_into_the_dishwasher()
 {
     Dishwasher washer = new Dishwasher();
     FineChinaTeacup teacup = new FineChinaTeacup();
     washer.Load(teacup);
 }
コード例 #17
0
 public void New_dishwasher_is_always_unlocked()
 {
     Dishwasher washer = new Dishwasher();
     Assert.IsFalse(washer.IsLocked);
 }
コード例 #18
0
 public void Ensure_that_you_cannot_load_objects_that_are_not_safe_into_the_dishwasher()
 {
     Dishwasher washer = new Dishwasher();
     Dog dog = new Dog();
     washer.Load(dog);
 }
コード例 #19
0
 public void New_dishwasher_is_always_empty()
 {
     Dishwasher washer = new Dishwasher();
     Assert.IsTrue(washer.IsEmpty);
 }