示例#1
0
        public void SquareBracketOperator()
        {
            AuthorityDataTypeList newAuthorityDataTypeList, oldAuthorityDataTypeList;
            Int32 authorityDataTypeIndex;

            // Test all authorityDataTypes
            oldAuthorityDataTypeList = GetAuthorityDataTypes(true);
            newAuthorityDataTypeList = new AuthorityDataTypeList();
            for (authorityDataTypeIndex = 0; authorityDataTypeIndex < oldAuthorityDataTypeList.Count; authorityDataTypeIndex++)
            {
                newAuthorityDataTypeList.Add(oldAuthorityDataTypeList[oldAuthorityDataTypeList.Count - authorityDataTypeIndex - 1]);
            }
            for (authorityDataTypeIndex = 0; authorityDataTypeIndex < oldAuthorityDataTypeList.Count; authorityDataTypeIndex++)
            {
                Assert.AreEqual(newAuthorityDataTypeList[authorityDataTypeIndex], oldAuthorityDataTypeList[oldAuthorityDataTypeList.Count - authorityDataTypeIndex - 1]);
            }

            // Test all selectecd by application id authorityDataTypes
            oldAuthorityDataTypeList = GetAuthorityDataTypesByApplicationId(true);
            newAuthorityDataTypeList = new AuthorityDataTypeList();
            for (authorityDataTypeIndex = 0; authorityDataTypeIndex < oldAuthorityDataTypeList.Count; authorityDataTypeIndex++)
            {
                newAuthorityDataTypeList.Add(oldAuthorityDataTypeList[oldAuthorityDataTypeList.Count - authorityDataTypeIndex - 1]);
            }
            for (authorityDataTypeIndex = 0; authorityDataTypeIndex < oldAuthorityDataTypeList.Count; authorityDataTypeIndex++)
            {
                Assert.AreEqual(newAuthorityDataTypeList[authorityDataTypeIndex], oldAuthorityDataTypeList[oldAuthorityDataTypeList.Count - authorityDataTypeIndex - 1]);
            }
        }
示例#2
0
        public void Constructor()
        {
            AuthorityDataTypeList addressTypes;

            addressTypes = new AuthorityDataTypeList();
            Assert.IsNotNull(addressTypes);
        }
示例#3
0
 private AuthorityDataTypeList GetAuthorityDataTypesByApplicationId(Boolean refresh)
 {
     if (_authorityDataTypes.IsNull() || refresh)
     {
         _authorityDataTypes = CoreData.UserManager.GetAuthorityDataTypesByApplicationId(GetUserContext(), Settings.Default.TestApplicationId);
     }
     return(_authorityDataTypes);
 }
示例#4
0
 private AuthorityDataTypeList GetAuthorityDataTypes(Boolean refresh)
 {
     if (_authorityDataTypes.IsNull() || refresh)
     {
         _authorityDataTypes = CoreData.UserManager.GetAuthorityDataTypes(GetUserContext());
     }
     return(_authorityDataTypes);
 }
示例#5
0
 public AuthorityDataTypeListTest()
 {
     _authorityDataTypes = null;
 }