Esempio n. 1
0
 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");
 }
Esempio n. 2
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");
 }
Esempio n. 3
0
 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);
     }
 }
Esempio n. 4
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);
     }
 }
Esempio n. 5
0
 public static void TestReplaceOfferingNoMatch(ConfigurationStore store)
 {
     DesktopOfferingElement offering = new DesktopOfferingElement() {
         Name = "should not match",
         Description = "this has been modified"
     };
     Console.WriteLine("Modify Desktop Offering {0}", offering.Name);
     try {
         store.ReplaceDesktopOffering(offering);
         Console.WriteLine("FAIL: replaced with a new name");
     } catch (ArgumentException e) {
         Console.WriteLine("PASS: Exception thrown: {0}", e.Message);
     }
 }
Esempio n. 6
0
 public static void TestReplaceOffering(ConfigurationStore store)
 {
     DesktopOfferingElement offering =  store.Configuration.DesktopOfferings.First() as DesktopOfferingElement;
     offering.Description += " (modified)";
     Console.WriteLine("Modify Desktop Offering {0}", offering.Name);
     store.ReplaceDesktopOffering(offering);
     IDesktopOffering result = store.Configuration.DesktopOfferings.FirstOrDefault(o => o.Description == offering.Description);
     Console.WriteLine((result != null) ? "PASS: offering was modified" : "FAIL: offering  not modified");
 }