Tmx.TestData.AddTestPlatform C# (CSharp) Method

AddTestPlatform() static private method

static private AddTestPlatform ( string testPlatformName, string testPlatformId, string testPlatformDesctiption, string testPlatformOS, string testPlatformVersion, string testPlatformArchitecture, string testPlatformLanguage ) : bool
testPlatformName string
testPlatformId string
testPlatformDesctiption string
testPlatformOS string
testPlatformVersion string
testPlatformArchitecture string
testPlatformLanguage string
return bool
        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) {
                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);
            
            CurrentTestPlatform = 
                TestPlatforms[TestPlatforms.Count - 1];
            
            if (CurrentTestPlatform != null)
                OnTmxNewTestPlatformCreated(CurrentTestPlatform, new EventArgs()); //null);
            
            if (Preferences.Storage) {
                using (var session = StorageHelper.SessionFactory.OpenSession()) {
                    session.Save(CurrentTestPlatform);
                }
            }
            
            result = true;
            return result;
        }