예제 #1
0
        public void the_dependency_function_invokes_the_correct_function()
        {
            var func = theObjectDef.Dependencies.First().ShouldBeOfType <ValueDependency>()
                       .Value.ShouldBeOfType <Func <ControllerTarget, Model1> >();

            var target = new ControllerTarget();

            func(target).Name.ShouldEqual("ZeroInOneOut");
        }
예제 #2
0
        public void the_dependency_function_invokes_the_correct_function()
        {
            var func = theObjectDef.Dependencies.First().ShouldBeOfType <ValueDependency>()
                       .Value.ShouldBeOfType <Func <ControllerTarget, Task <Model2> > >();

            var target = new ControllerTarget();
            var task   = func(target);

            task.RunSynchronously();
            task.Result.Name.ShouldEqual("ZeroInTaskWithOutputOut");
        }
예제 #3
0
        public void the_dependency_function_invokes_the_correct_function()
        {
            var func = theObjectDef.Dependencies.First().ShouldBeOfType <ValueDependency>()
                       .Value.ShouldBeOfType <Func <ControllerTarget, Model1, Model2> >();

            var target = new ControllerTarget();

            func(target, new Model1 {
                Name = "Jeremy"
            }).Name.ShouldEqual("Jeremy");
        }
예제 #4
0
        public void the_dependency_function_invokes_the_correct_function()
        {
            var func = theObjectDef.Dependencies.First().ShouldBeOfType <ValueDependency>()
                       .Value.ShouldBeOfType <Func <ControllerTarget, Model1, Task> >();

            var target = new ControllerTarget();
            var task   = func(target, new Model1 {
                Name = "Corey"
            });

            task.RunSynchronously();

            target.LastNameEntered.ShouldEqual("Corey");
        }
예제 #5
0
        public void the_dependency_function_invokes_the_correct_function()
        {
            var func = theObjectDef.Dependencies.First().ShouldBeOfType<ValueDependency>()
                .Value.ShouldBeOfType<Func<ControllerTarget, Model1>>();

            var target = new ControllerTarget();
            func(target).Name.ShouldEqual("ZeroInOneOut");
        }
예제 #6
0
        public void the_dependency_function_invokes_the_correct_function()
        {
            var func = theObjectDef.Dependencies.First().ShouldBeOfType<ValueDependency>()
                .Value.ShouldBeOfType<Action<ControllerTarget, Model1>>();

            var target = new ControllerTarget();
            func(target, new Model1
            {
                Name = "Jeremy"
            });

            target.LastNameEntered.ShouldEqual("Jeremy");
        }