Ejemplo n.º 1
0
 public static void TestAddOffering(ConfigurationStore store)
 {
     //DesktopOfferingElement offering = new DesktopOfferingElement() ;
     DesktopOfferingElement offering = store.Configuration.DesktopOfferings.First() as DesktopOfferingElement;
     offering.Name = "new offering";
     Console.WriteLine("Add new Desktop Offering {0}", offering.Name);
     store.AddDesktopOffering(offering);
     IDesktopOffering result = store.Configuration.DesktopOfferings.FirstOrDefault(o => o.Name == offering.Name);
     Console.WriteLine((result != null) ? "PASS: offering was added" : "FAIL: offering  not added");
 }
Ejemplo n.º 2
0
 public static void TestAddDuplicateOffering(ConfigurationStore store)
 {
     IDesktopOffering existing = store.Configuration.DesktopOfferings.First();
     Console.WriteLine("Add duplicate Desktop Offering {0}", existing.Name);
     DesktopOfferingElement offering = new DesktopOfferingElement() {
         Name = existing.Name,
     };
     try {
         store.AddDesktopOffering(offering);
         Console.WriteLine("FAIL: added a duplicate desktop offering to the store");
     } catch (ArgumentException e) {
         Console.WriteLine("PASS: Exception thrown: {0}", e.Message);
     }
 }