Ejemplo n.º 1
0
        public void FunctionWithNullFunctionThrows()
        {
            var e = Assert.Throws <ArgumentNullException>(() =>
                                                          Reader.Function <object, object>(null));

            Assert.Equal("reader", e.ParamName);
        }
Ejemplo n.º 2
0
        public void FunctionInvokesFunction()
        {
            var read   = false;
            var reader = Reader.Function((object e) =>
            {
                read = true;
                return(e);
            });
            var env    = new object();
            var result = reader.Read(env);

            Assert.True(read);
            Assert.Same(env, result);
        }