Пример #1
0
        public void ToDelegate()
        {
            Func <Dummy, DummyResult> middlewareResult = _ => new DummyResult();
            var middleware = new SpyMiddleware(middlewareResult);
            Func <Dummy, DummyResult> next = _ => new DummyResult();

            new TestCaseRunner()
            .Run(() => MiddlewareExtensions.ToDelegate(middleware)(next))
            .Verify((actual, desc) => {
                Assert.AreEqual(middlewareResult, actual, desc);

                Assert.AreEqual(next, middleware.ActualNext, desc);
            }, (Type)null);
        }
Пример #2
0
 public void ToDelegate_Null()
 {
     new TestCaseRunner()
     .Run(() => MiddlewareExtensions.ToDelegate((SpyMiddleware)null))
     .Verify((actual, desc) => { }, typeof(ArgumentNullException));
 }