Esempio n. 1
0
        public void TestIsAuditEnabled()
        {
            var settingsLoader = new TypeAuditClassSettingsLoader();

            Assert.True(settingsLoader.IsAuditEnabled(typeof(AuditClassWithSettings)));

            TestWithExpectedException(() => settingsLoader.IsAuditEnabled(typeof(AuditClassWithoutSettings)));
        }
Esempio n. 2
0
        public void TestIsAuditEnabledForOperation()
        {
            var settingsLoader = new TypeAuditClassSettingsLoader();

            Assert.True(settingsLoader.IsAuditEnabled(typeof(AuditClassWithSettings), tTypeOfAuditOperation.SELECT));
            Assert.True(settingsLoader.IsAuditEnabled(typeof(AuditClassWithSettings), tTypeOfAuditOperation.INSERT));
            Assert.True(settingsLoader.IsAuditEnabled(typeof(AuditClassWithSettings), tTypeOfAuditOperation.UPDATE));
            Assert.True(settingsLoader.IsAuditEnabled(typeof(AuditClassWithSettings), tTypeOfAuditOperation.DELETE));
            //Assert.False(settingsLoader.IsAuditEnabled(typeof(AuditClassWithSettings), tTypeOfAuditOperation.EXECUTE));

            TestWithExpectedException(() => settingsLoader.IsAuditEnabled(typeof(AuditClassWithoutSettings), tTypeOfAuditOperation.SELECT));
            TestWithExpectedException(() => settingsLoader.IsAuditEnabled(typeof(AuditClassWithoutSettings), tTypeOfAuditOperation.INSERT));
            TestWithExpectedException(() => settingsLoader.IsAuditEnabled(typeof(AuditClassWithoutSettings), tTypeOfAuditOperation.UPDATE));
            TestWithExpectedException(() => settingsLoader.IsAuditEnabled(typeof(AuditClassWithoutSettings), tTypeOfAuditOperation.DELETE));
            //TestWithExpectedException(() => settingsLoader.IsAuditEnabled(typeof(AuditClassWithoutSettings), tTypeOfAuditOperation.EXECUTE));
        }