public static void TestDeleteOffering(ConfigurationStore store) { IDesktopOffering existing = store.Configuration.DesktopOfferings.First(); Console.WriteLine("Delete Desktop Offering {0}", existing.Name); store.DeleteDesktopOffering(existing.Name); IDesktopOffering result = store.Configuration.DesktopOfferings.FirstOrDefault(o => o.Name == existing.Name); Console.WriteLine( (result == null) ? "PASS: offering was deleted" : "FAIL: offering still exists"); }
public static void TestDeleteOfferingNoMatch(ConfigurationStore store) { string Name = "should not match"; Console.WriteLine("Delete Desktop Offering {0}", Name); try { store.DeleteDesktopOffering(Name); Console.WriteLine("FAIL: replaced with a new name"); } catch (ArgumentException e) { Console.WriteLine("PASS: Exception thrown: {0}", e.Message); } }