Esempio 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);
        }
Esempio n. 2
0
        public void Suppression_can_be_flagged_by_calling_SuppressExecution()
        {
            var interceptionContext = new DbCommandInterceptionContext <string>();

            interceptionContext.SuppressExecution();

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