/// <summary> /// Override the base TestInitialize function /// </summary> protected override void TestInitialize() { base.TestInitialize(); if (this.ASRMAdapter == null) { this.ASRMAdapter = this.Site.GetAdapter<IMS_ASRMAdapter>(); } this.ASRMSUTControlAdapter = this.Site.GetAdapter<IMS_ASRMSUTControlAdapter>(); // If implementation doesn't support this specification [MS-ASRM], the case will not start. if (!bool.Parse(Common.GetConfigurationPropertyValue("MS-ASRM_Supported", this.Site))) { this.Site.Assert.Inconclusive("This test suite is not supported under current SUT, because MS-ASRM_Supported value is set to false in MS-ASRM_{0}_SHOULDMAY.deployment.ptfconfig file.", Common.GetSutVersion(this.Site)); } // Set the information of User1. this.UserOneInformation = new UserInformation { UserName = Common.GetConfigurationPropertyValue("User1Name", this.Site), UserPassword = Common.GetConfigurationPropertyValue("User1Password", this.Site), UserDomain = Common.GetConfigurationPropertyValue("Domain", this.Site) }; // Set the information of User2. this.UserTwoInformation = new UserInformation { UserName = Common.GetConfigurationPropertyValue("User2Name", this.Site), UserPassword = Common.GetConfigurationPropertyValue("User2Password", this.Site), UserDomain = Common.GetConfigurationPropertyValue("Domain", this.Site) }; // Set the information of User3. this.UserThreeInformation = new UserInformation { UserName = Common.GetConfigurationPropertyValue("User3Name", this.Site), UserPassword = Common.GetConfigurationPropertyValue("User3Password", this.Site), UserDomain = Common.GetConfigurationPropertyValue("Domain", this.Site) }; // Set the information of User4. this.UserFourInformation = new UserInformation { UserName = Common.GetConfigurationPropertyValue("User4Name", this.Site), UserPassword = Common.GetConfigurationPropertyValue("User4Password", this.Site), UserDomain = Common.GetConfigurationPropertyValue("Domain", this.Site) }; string sutComputerName = Common.GetConfigurationPropertyValue("SutComputerName", this.Site); if (bool.Parse(Common.GetConfigurationPropertyValue("MS-ASRM_Supported", this.Site))) { if (Common.GetConfigurationPropertyValue("TransportType", this.Site) .Equals("HTTPS", StringComparison.CurrentCultureIgnoreCase)) { // Use the user who is in Administrators group to enable the SSL setting. bool isSSLUpdated = this.ASRMSUTControlAdapter.ConfigureSSLSetting( sutComputerName, this.UserFourInformation.UserName, this.UserFourInformation.UserPassword, this.UserFourInformation.UserDomain, true); this.Site.Assert.IsTrue(isSSLUpdated, "The SSL setting of protocol web service should be enabled."); } } if (Common.GetSutVersion(this.Site) != SutVersion.ExchangeServer2007 || string.Equals(Common.GetConfigurationPropertyValue("ActiveSyncProtocolVersion", this.Site), "12.1")) { this.SwitchUser(this.UserOneInformation, true); } }
/// <summary> /// Override the base TestInitialize function /// </summary> protected override void TestInitialize() { base.TestInitialize(); if (this.ASRMAdapter == null) { this.ASRMAdapter = this.Site.GetAdapter <IMS_ASRMAdapter>(); } this.ASRMSUTControlAdapter = this.Site.GetAdapter <IMS_ASRMSUTControlAdapter>(); // If implementation doesn't support this specification [MS-ASRM], the case will not start. if (!bool.Parse(Common.GetConfigurationPropertyValue("MS-ASRM_Supported", this.Site))) { this.Site.Assert.Inconclusive("This test suite is not supported under current SUT, because MS-ASRM_Supported value is set to false in MS-ASRM_{0}_SHOULDMAY.deployment.ptfconfig file.", Common.GetSutVersion(this.Site)); } // Set the information of User1. this.UserOneInformation = new UserInformation { UserName = Common.GetConfigurationPropertyValue("User1Name", this.Site), UserPassword = Common.GetConfigurationPropertyValue("User1Password", this.Site), UserDomain = Common.GetConfigurationPropertyValue("Domain", this.Site) }; // Set the information of User2. this.UserTwoInformation = new UserInformation { UserName = Common.GetConfigurationPropertyValue("User2Name", this.Site), UserPassword = Common.GetConfigurationPropertyValue("User2Password", this.Site), UserDomain = Common.GetConfigurationPropertyValue("Domain", this.Site) }; // Set the information of User3. this.UserThreeInformation = new UserInformation { UserName = Common.GetConfigurationPropertyValue("User3Name", this.Site), UserPassword = Common.GetConfigurationPropertyValue("User3Password", this.Site), UserDomain = Common.GetConfigurationPropertyValue("Domain", this.Site) }; // Set the information of User4. this.UserFourInformation = new UserInformation { UserName = Common.GetConfigurationPropertyValue("User4Name", this.Site), UserPassword = Common.GetConfigurationPropertyValue("User4Password", this.Site), UserDomain = Common.GetConfigurationPropertyValue("Domain", this.Site) }; string sutComputerName = Common.GetConfigurationPropertyValue("SutComputerName", this.Site); if (bool.Parse(Common.GetConfigurationPropertyValue("MS-ASRM_Supported", this.Site))) { if (Common.GetConfigurationPropertyValue("TransportType", this.Site) .Equals("HTTPS", StringComparison.CurrentCultureIgnoreCase)) { // Use the user who is in Administrators group to enable the SSL setting. bool isSSLUpdated = this.ASRMSUTControlAdapter.ConfigureSSLSetting( sutComputerName, this.UserFourInformation.UserName, this.UserFourInformation.UserPassword, this.UserFourInformation.UserDomain, true); this.Site.Assert.IsTrue(isSSLUpdated, "The SSL setting of protocol web service should be enabled."); } } if (Common.GetSutVersion(this.Site) != SutVersion.ExchangeServer2007 || string.Equals(Common.GetConfigurationPropertyValue("ActiveSyncProtocolVersion", this.Site), "12.1")) { this.SwitchUser(this.UserOneInformation, true); } }