コード例 #1
0
        public void GetAccessTypesFromAssembly()
        {
            List <EnumValueInfo> actualAccessTypes = _accessTypeReflector.GetAccessTypesFromAssembly(typeof(PaperFile).Assembly, _cache);

            Assert.That(actualAccessTypes, Is.Not.Null);
            Assert.That(actualAccessTypes.Count, Is.EqualTo(2));
            EnumValueInfoAssert.Contains("Journalize", actualAccessTypes);
            EnumValueInfoAssert.Contains("Archive", actualAccessTypes);
        }
コード例 #2
0
        public void GetAccessTypesFromType_SecuredProperties()
        {
            List <EnumValueInfo> actualAccessTypes = _accessTypeReflector.GetAccessTypesFromType(typeof(SecurableObjectWithSecuredProperties), _cache);

            Assert.That(actualAccessTypes, Is.Not.Null);
            Assert.That(actualAccessTypes.Count, Is.EqualTo(8));
            EnumValueInfoAssert.Contains("Create", actualAccessTypes);
            EnumValueInfoAssert.Contains("Read", actualAccessTypes);
            EnumValueInfoAssert.Contains("Edit", actualAccessTypes);
            EnumValueInfoAssert.Contains("Delete", actualAccessTypes);
            EnumValueInfoAssert.Contains("Search", actualAccessTypes);
            EnumValueInfoAssert.Contains("Find", actualAccessTypes);
            EnumValueInfoAssert.Contains("ReadSecret", actualAccessTypes);
            EnumValueInfoAssert.Contains("WriteSecret", actualAccessTypes);
        }
コード例 #3
0
        public void GetAccessTypesFromStaticMethods()
        {
            List <EnumValueInfo> actualAccessTypes = _accessTypeReflector.GetAccessTypesFromType(typeof(SecurableObjectWithSecuredStaticMethods), _cache);

            Assert.That(actualAccessTypes, Is.Not.Null);
            Assert.That(actualAccessTypes.Count, Is.EqualTo(9));
            EnumValueInfoAssert.Contains("Create", actualAccessTypes);
            EnumValueInfoAssert.Contains("Read", actualAccessTypes);
            EnumValueInfoAssert.Contains("Edit", actualAccessTypes);
            EnumValueInfoAssert.Contains("Delete", actualAccessTypes);
            EnumValueInfoAssert.Contains("Search", actualAccessTypes);
            EnumValueInfoAssert.Contains("Find", actualAccessTypes);
            EnumValueInfoAssert.Contains("First", actualAccessTypes);
            EnumValueInfoAssert.Contains("Second", actualAccessTypes);
            EnumValueInfoAssert.Contains("Third", actualAccessTypes);
        }