示例#1
0
        public void ExtensionsInterceptInCorrectOrder()
        {
            var logExtensions = new TestActions.LogExtensions();
            _executioner.Execute(logExtensions);

            Assert.IsNotNull(logExtensions.GetConditionLog());
            Assert.IsNotNull(logExtensions.GetSessionBeginLog());
            Assert.IsNotNull(logExtensions.GetPreEventLog());
            Assert.IsNotNull(logExtensions.GetActionLog());
            Assert.IsNotNull(logExtensions.GetPostEventLog());
            Assert.IsNotNull(logExtensions.GetSessionEndLog());
            Assert.IsNull(logExtensions.GetExceptionHandlerLog()); //should be null
            Assert.IsNotNull(logExtensions.GetRecklessLog());

            Assert.Less(logExtensions.GetConditionLog(), logExtensions.GetSessionBeginLog());
            Assert.Less(logExtensions.GetSessionBeginLog(), logExtensions.GetPreEventLog());
            Assert.Less(logExtensions.GetPreEventLog(), logExtensions.GetActionLog());
            Assert.Less(logExtensions.GetActionLog(), logExtensions.GetPostEventLog());
            Assert.Less(logExtensions.GetPostEventLog(), logExtensions.GetSessionEndLog());
            Assert.Less(logExtensions.GetSessionEndLog(), logExtensions.GetRecklessLog());
        }
示例#2
0
        public void ThereIsNoExtensionThatInterceptsAfterExceptionButReckless()
        {
            var logExtensions = new TestActions.LogExtensions { ThrowNewException = true };
            _executioner.Execute(logExtensions);

            Assert.IsNotNull(logExtensions.GetConditionLog());
            Assert.IsNotNull(logExtensions.GetSessionBeginLog());
            Assert.IsNotNull(logExtensions.GetPreEventLog());
            Assert.IsNull(logExtensions.GetActionLog());
            Assert.IsNull(logExtensions.GetPostEventLog());
            Assert.IsNull(logExtensions.GetSessionEndLog());
            Assert.IsNotNull(logExtensions.GetExceptionHandlerLog());
            Assert.IsNotNull(logExtensions.GetRecklessLog());

            Assert.Less(logExtensions.GetConditionLog(), logExtensions.GetSessionBeginLog());
            Assert.Less(logExtensions.GetSessionBeginLog(), logExtensions.GetPreEventLog());
            Assert.Less(logExtensions.GetPreEventLog(), logExtensions.GetExceptionHandlerLog());
            Assert.Less(logExtensions.GetExceptionHandlerLog(), logExtensions.GetRecklessLog());
        }