Пример #1
0
 /// <summary>
 /// Private constructor of the Singleton without args
 /// </summary>
 private Cuisine()
 {
     this.Stock      = null;
     this.Machines   = null;
     this.Ustenciles = null;
     this.PassePlat  = null;
 }
Пример #2
0
 /// <summary>
 /// Private constructor of the Singleton without args
 /// </summary>
 private Cuisine(Stock stock, Machines[] machines, Ustenciles ustenciles, PassePlat passePlat)
 {
     this.Stock      = stock;
     this.Machines   = machines;
     this.Ustenciles = ustenciles;
     this.PassePlat  = passePlat;
 }
Пример #3
0
 /// <summary>
 /// Creation and return of the singleton without args
 /// </summary>
 public static PassePlat GetInstance()
 {
     if (Instance is null)
     {
         Instance = new PassePlat();
     }
     return(Instance);
 }
Пример #4
0
 public CuisineTest()
 {
     stock        = Stock.GetInstance();
     machinesUn   = new Machines("test1", 35);
     machinesDeux = new Machines("test3", 35);
     array        = new Machines[2] {
         machinesDeux, machinesUn
     };
     ustenciles = Ustenciles.GetInstance();
     passePlat  = PassePlat.GetInstance();
 }
Пример #5
0
 /// <summary>
 /// Creation and return of the singleton with args
 /// </summary>
 public static Cuisine GetInstance(Stock stock, Machines[] machines, Ustenciles ustenciles, PassePlat passePlat)
 {
     if (Instance == null)
     {
         Cuisine.Instance = new Cuisine(stock, machines, ustenciles, passePlat);
     }
     return(Cuisine.Instance);
 }
Пример #6
0
 public void TestSingletonPassePlat()
 {
     Assert.AreEqual(PassePlat.GetInstance(), PassePlat.GetInstance(), "PassePlat is not a singleton");
 }