Ejemplo n.º 1
0
        public void Calling_SuppressExecution_after_execution_throws()
        {
            var interceptionContext = new DbCommandInterceptionContext <string>();

            ((IDbMutableInterceptionContext <string>)interceptionContext).MutableData.SetExecuted("Wensleydale");

            Assert.Equal(
                Strings.SuppressionAfterExecution,
                Assert.Throws <InvalidOperationException>(() => interceptionContext.SuppressExecution()).Message);
        }
Ejemplo n.º 2
0
        public void Suppression_can_be_flagged_by_calling_SuppressExecution()
        {
            var interceptionContext = new DbCommandInterceptionContext <string>();

            interceptionContext.SuppressExecution();

            Assert.True(interceptionContext.IsExecutionSuppressed);
            Assert.Null(interceptionContext.Result);
            Assert.Null(interceptionContext.Exception);
        }
        public void Calling_SuppressExecution_after_execution_throws()
        {
            var interceptionContext = new DbCommandInterceptionContext<string>();

            ((IDbMutableInterceptionContext<string>)interceptionContext).MutableData.SetExecuted("Wensleydale");

            Assert.Equal(
                Strings.SuppressionAfterExecution,
                Assert.Throws<InvalidOperationException>(() => interceptionContext.SuppressExecution()).Message);
        }
        public void Suppression_can_be_flagged_by_calling_SuppressExecution()
        {
            var interceptionContext = new DbCommandInterceptionContext<string>();

            interceptionContext.SuppressExecution();

            Assert.True(interceptionContext.IsExecutionSuppressed);
            Assert.Null(interceptionContext.Result);
            Assert.Null(interceptionContext.Exception);
        }