Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        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);
        }