Пример #1
0
		public void Create_should_return_null_if_receive_type_as_null_reference()
		{
			//arrange
			var target = new ControllerActivator(new StandardKernel());
			//act
			var actual = target.Create(Substitute.For<RequestContext>(), null);
			//assert
			Assert.IsNull(actual);
		}
Пример #2
0
		public void Create_should_return_controller()
		{
			//arrange
			var controllerModule = new ControllerModule { TestController = new TestController() };
			var kernel = new StandardKernel(controllerModule);
			var target = new ControllerActivator(kernel);
			//act
			var actual = target.Create(Substitute.For<RequestContext>(), typeof(TestController));
			//assert
			Assert.AreSame(controllerModule.TestController, actual);
		}