Пример #1
0
        public void SupportsDefaultActionClassAttribute()
        {
            IAsyncController controller = new ControllerWithAsyncActionAndHelpers();

            var context = services.ControllerContextFactory.
                          Create("", "ControllerWithAsyncAction", "NonExistingAction", services.ControllerDescriptorProvider.BuildDescriptor(controller));

            var ar = controller.BeginProcess(engineContext, context);

            context.Async.Result = ar;
            ar.AsyncWaitHandle.WaitOne();
            controller.EndProcess();

            Assert.AreEqual("foo", response.OutputContent);
        }
Пример #2
0
        public void CanExecuteActionAsynchronouslyOnControllerWithHelpers()
        {
            IAsyncController controller = new ControllerWithAsyncActionAndHelpers();

            var context = services.ControllerContextFactory.
                          Create("", "ControllerWithAsyncAction", "index", services.ControllerDescriptorProvider.BuildDescriptor(controller));

            var ar = controller.BeginProcess(engineContext, context);

            context.Async.Result = ar;
            ar.AsyncWaitHandle.WaitOne();
            controller.EndProcess();

            Assert.AreEqual("foo", response.OutputContent);
        }
		public void SupportsDefaultActionClassAttribute()
		{
			IAsyncController controller = new ControllerWithAsyncActionAndHelpers();

			var context = services.ControllerContextFactory.
				Create("", "ControllerWithAsyncAction", "NonExistingAction", services.ControllerDescriptorProvider.BuildDescriptor(controller));

			var ar = controller.BeginProcess(engineContext, context);
			context.Async.Result = ar;
			ar.AsyncWaitHandle.WaitOne();
			controller.EndProcess();

			Assert.AreEqual("foo", response.OutputContent);
		}
		public void CanExecuteActionAsynchronouslyOnControllerWithHelpers()
		{
			IAsyncController controller = new ControllerWithAsyncActionAndHelpers();

			var context = services.ControllerContextFactory.
				Create("", "ControllerWithAsyncAction", "index", services.ControllerDescriptorProvider.BuildDescriptor(controller));

			var ar = controller.BeginProcess(engineContext, context);
			context.Async.Result = ar;
			ar.AsyncWaitHandle.WaitOne();
			controller.EndProcess();

			Assert.AreEqual("foo", response.OutputContent);
		}