コード例 #1
0
        public void GetHandlerController_NoController_Null()
        {
            // Assign

            _metaStore.SetupGet(x => x.ControllersMetaData).Returns(new List <IControllerMetaData>());
            _agent = new ControllersAgent(_metaStore.Object, _routeMatcher.Object);

            // Act & Assert
            Assert.IsNull(_agent.GetHandlerController(HandlerControllerType.Http404Handler));
        }
コード例 #2
0
        public void GetHandlerController_HaveController_ControllerMetaDataReturned()
        {
            // Assign

            _metaStore.SetupGet(x => x.ControllersMetaData).Returns(new List <IControllerMetaData>
            {
                new ControllerMetaData(null, null, new ControllerRole(false, false, true))
            });

            _agent = new ControllersAgent(_metaStore.Object, _routeMatcher.Object);

            // Act
            var metaData = _agent.GetHandlerController(HandlerControllerType.Http404Handler);

            // Assert

            Assert.IsTrue(metaData.Role.Is404Handler);
        }