Пример #1
0
 private void CreateSecurityMappings()
 {
     myMapping = StandardPISystem.SecurityMappings[Constants.AF_SECURITY_MAPPING_NAME];
     if (myMapping == null)
     {
         myMapping             = _piSystem.SecurityMappings.Add(Constants.AF_SECURITY_MAPPING_NAME, null, myIdentity);
         myMapping.Description = "Current User Mapping";
         myMapping.CheckIn();
     }
 }
        public void DeleteTest()
        {
            string path = Constants.AF_SECURITY_MAPPING_PATH;

            instance.Delete(webId);
            StandardPISystem.Refresh();
            AFSecurityMapping mySecurityMapping = AFObject.FindObject(path) as AFSecurityMapping;

            Assert.IsNull(mySecurityMapping);
            DeleteSampleDatabaseForTests();
            CreateSampleDatabaseForTests();
        }
        public void UpdateTest()
        {
            string path = Constants.AF_SECURITY_MAPPING_PATH;

            PISecurityMapping securityMapping = instance.Get(webId, null);

            securityMapping.WebId       = null;
            securityMapping.Id          = null;
            securityMapping.Links       = null;
            securityMapping.Account     = null;
            securityMapping.Path        = null;
            securityMapping.Description = "This is the new security mapping swagger description";
            instance.Update(webId, securityMapping);

            StandardPISystem.Refresh();
            AFSecurityMapping mySecurityMapping = AFObject.FindObject(path) as AFSecurityMapping;

            if (mySecurityMapping != null)
            {
                Assert.IsTrue(mySecurityMapping.Description == securityMapping.Description);
            }
        }