Description of TestPlatform.
Inheritance: ITestPlatform
Beispiel #1
0
 internal static bool AddTestPlatform(
     string testPlatformName,
     string testPlatformId,
     string testPlatformDesctiption,
     string testPlatformOS,
     string testPlatformVersion,
     string testPlatformArchitecture,
     string testPlatformLanguage)
 {
     bool result = false;
     
     if (string.IsNullOrEmpty(testPlatformId))
         testPlatformId = GetTestPlatformId();
     
     var alreadyExistingTestPlatform = GetTestPlatform(testPlatformName, testPlatformId);
     if (null != alreadyExistingTestPlatform) {
         TestData.CurrentTestPlatform = alreadyExistingTestPlatform;
         // the test platform requested won't be duplicated, exit
         return false;
     }
     
     var testPlatform = new TestPlatform {
         Id = testPlatformId,
         Name = testPlatformName,
         OperatingSystem = testPlatformOS,
         Version = testPlatformVersion,
         Architecture = testPlatformArchitecture,
         Language = testPlatformLanguage,
         Description = testPlatformDesctiption
     };
     TestPlatforms.Add(testPlatform);
     
     TestData.CurrentTestPlatform = 
         TestData.TestPlatforms[TestPlatforms.Count - 1];
     
     if (TestData.CurrentTestPlatform != null)
         OnTmxNewTestPlatformCreated(TestData.CurrentTestPlatform, new EventArgs()); //null);
     
     if (Preferences.Storage) {
         using (var session = StorageHelper.SessionFactory.OpenSession()) {
             session.Save(TestData.CurrentTestPlatform);
         }
     }
     
     result = true;
     return result;
 }