Example #1
0
        public void ReverseCrossRefAccess()
        {
            // arrange
            LibraryStub();
            var helper = new SecurityHelper();
            var dynamicManager = new Mock<IDynamicTypeManager>();

            dynamicManager.Setup(x => x.GetInfoType<IInfoClass>("Employee")).Returns(typeof(Employee));
            helper.DynamicManager = dynamicManager.Object;

            var result = helper.ReverseCrossRefAccess("Employee", "ProcessWithSingleCr");
            Assert.IsFalse(result);
        }
Example #2
0
        public void GetAllowAccessList()
        {
            // arrange
            LibraryStub();
            var helper = new SecurityHelper();
            var dynamicManager = new Mock<IDynamicTypeManager>();

            dynamicManager.Setup(x => x.GetInfoType<IInfoClass>("Employee")).Returns(typeof(Employee));
            helper.DynamicManager = dynamicManager.Object;

            // act
            var allowAccessList = helper.GetAllowAccessList("Employee", "FirstName", "Salary");

            // assert
            Assert.AreEqual("FirstName", allowAccessList.First());
            Assert.AreEqual("Salary", allowAccessList.Last());
        }