/// <summary> /// Creation and return of the singleton with args /// </summary> public static ChefSucre GetInstance(String nom, String prenom) { if (Instance == null) { ChefSucre.Instance = new ChefSucre(nom, prenom); } return(ChefSucre.Instance); }
/// <summary> /// Creation and return of the singleton without args /// </summary> public static ChefSucre GetInstance() { if (Instance == null) { ChefSucre.Instance = new ChefSucre(); } return(ChefSucre.Instance); }
public void TestSingletonChefSucre() { Assert.AreEqual(ChefSucre.GetInstance("test", "test"), ChefSucre.GetInstance(), "ChefSucre is not a singleton"); }