/// <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); }
/// <summary> /// Creation and return of the singleton without args /// </summary> public static ChefSale GetInstance() { if (Instance == null) { ChefSale.Instance = new ChefSale(); } return(ChefSale.Instance); }
public void TestSingletonChefSale() { Assert.AreEqual(ChefSale.GetInstance("test", "test"), ChefSale.GetInstance(), "ChefSale is not a singleton"); }