Microsoft.Protocols.TestSuites.MS_ADMINS.S01_CreateAndDeleteSite.MSADMINS_S01_TC14_CreateSiteSuccessfully_TitleLessThanMaxLength C# (CSharp) Method

MSADMINS_S01_TC14_CreateSiteSuccessfully_TitleLessThanMaxLength() private method

        public void MSADMINS_S01_TC14_CreateSiteSuccessfully_TitleLessThanMaxLength()
        {
            // Call GetLanguages method to obtain LCID values used in the protocol server deployment. 
            GetLanguagesResponseGetLanguagesResult lcids = this.adminsAdapter.GetLanguages();
            Site.Assert.IsNotNull(lcids, "Get languages should succeed and a list of LCIDs should return. If no LCID returns the get languages method is failed.");

            int lcid = lcids.Languages[0];
            string title = TestSuiteBase.GenerateRandomString(254);
            string url = Common.GetConfigurationPropertyValue("UrlWithOutPort", this.Site) + TestSuiteBase.GenerateUniqueSiteTitle();
            string description = TestSuiteBase.GenerateRandomString(20);
            string webTemplate = Common.GetConfigurationPropertyValue("CustomizedTemplate", this.Site);
            string ownerLogin = Common.GetConfigurationPropertyValue("OwnerLogin", this.Site);
            string ownerName = TestSuiteBase.GenerateUniqueOwnerName();
            string ownerEmail = TestSuiteBase.GenerateEmail(20);
            string portalUrl = TestSuiteBase.GeneratePortalUrl(20);
            string portalName = TestSuiteBase.GenerateUniquePortalName();

            // Call CreateSite method to create a site collection with the length of title less than maximum characters 255.
            string result = this.adminsAdapter.CreateSite(url, title, description, lcid, webTemplate, ownerLogin, ownerName, ownerEmail, portalUrl, portalName);
            Site.Assert.IsTrue(Uri.IsWellFormedUriString(result, UriKind.Absolute), "Create site should succeed.");

            // If create site successfully with the length of title less than maximum characters 255, then MS-ADMINS_R3015 can be verified.
            Site.CaptureRequirement(
            3015,
                @"[In CreateSite]If the length of the Title is 254 characters, the CreateSite operation will succeed.");
            
            // Call DeleteSite method to delete the site collection created in above steps.
            this.adminsAdapter.DeleteSite(result);
        }
S01_CreateAndDeleteSite