Example #1
0
 /// <summary>
 /// Creation and return of the singleton with args
 /// </summary>
 public static ChefSale GetInstance(String nom, String prenom)
 {
     if (Instance == null)
     {
         ChefSale.Instance = new ChefSale(nom, prenom);
     }
     return(ChefSale.Instance);
 }
Example #2
0
 /// <summary>
 /// Creation and return of the singleton without args
 /// </summary>
 public static ChefSale GetInstance()
 {
     if (Instance == null)
     {
         ChefSale.Instance = new ChefSale();
     }
     return(ChefSale.Instance);
 }
Example #3
0
 public void TestSingletonChefSale()
 {
     Assert.AreEqual(ChefSale.GetInstance("test", "test"), ChefSale.GetInstance(), "ChefSale is not a singleton");
 }