private void DeleteSecurityIdentities() { AFSecurityIdentity myIdentity = _piSystem.SecurityIdentities["SwaggerUser"]; if (myIdentity != null) { _piSystem.SecurityIdentities.Remove(myIdentity); } }
private void CreateSecurityIdentities() { myIdentity = StandardPISystem.SecurityIdentities[Constants.AF_SECURITY_IDENTITY_NAME]; if (myIdentity == null) { myIdentity = StandardPISystem.SecurityIdentities.Add(Constants.AF_SECURITY_IDENTITY_NAME); myIdentity.Description = "Test User Identity"; myIdentity.CheckIn(); } }
public void DeleteTest() { string path = Constants.AF_SECURITY_IDENTITY_PATH; instance.Delete(webId); StandardPISystem.Refresh(); AFSecurityIdentity mySecurityIdentity = AFObject.FindObject(path) as AFSecurityIdentity; Assert.IsNull(mySecurityIdentity); DeleteSampleDatabaseForTests(); CreateSampleDatabaseForTests(); }
public void UpdateTest() { string path = Constants.AF_SECURITY_IDENTITY_PATH; PISecurityIdentity securityIdentity = instance.Get(webId, null); securityIdentity.WebId = null; securityIdentity.Id = null; securityIdentity.Links = null; securityIdentity.Path = null; securityIdentity.Description = "This is the new security identity swagger description"; instance.Update(webId, securityIdentity); StandardPISystem.Refresh(); AFSecurityIdentity mySecurityIdentity = AFObject.FindObject(path) as AFSecurityIdentity; if (mySecurityIdentity != null) { Assert.IsTrue(mySecurityIdentity.Description == securityIdentity.Description); } }