public void DefaultControllerActivator_ReleasesNonIDisposableController() { // Arrange var activator = new DefaultControllerActivator(Mock.Of <ITypeActivatorCache>()); var controller = new object(); // Act + Assert (does not throw) activator.Release(Mock.Of <ControllerContext>(), controller); }
public void Release_DisposesController_IfDisposable() { // Arrange var controller = new MyController(); var activator = new DefaultControllerActivator(Mock.Of <ITypeActivatorCache>()); // Act activator.Release(new ControllerContext(), controller); // Assert Assert.True(controller.Disposed); }
public void DefaultControllerActivator_ReleasesNonIDisposableController() { // Arrange var activator = new DefaultControllerActivator(Mock.Of<ITypeActivatorCache>()); var controller = new object(); // Act + Assert (does not throw) activator.Release(Mock.Of<ControllerContext>(), controller); }
public void Release_DisposesController_IfDisposable() { // Arrange var controller = new MyController(); var activator = new DefaultControllerActivator(Mock.Of<ITypeActivatorCache>()); // Act activator.Release(new ControllerContext(), controller); // Assert Assert.Equal(true, controller.Disposed); }