示例#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);
    }
示例#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.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);
        }