/// <summary> /// Private constructor of the Singleton without args /// </summary> private Cuisine() { this.Stock = null; this.Machines = null; this.Ustenciles = null; this.PassePlat = null; }
/// <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; }
/// <summary> /// Creation and return of the singleton without args /// </summary> public static PassePlat GetInstance() { if (Instance is null) { Instance = new PassePlat(); } return(Instance); }
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(); }
/// <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); }
public void TestSingletonPassePlat() { Assert.AreEqual(PassePlat.GetInstance(), PassePlat.GetInstance(), "PassePlat is not a singleton"); }