public WebHookReceiversControllerTests()
        {
            _managerMock = new Mock<IWebHookReceiverManager>();
            _config = HttpConfigurationMock.Create(new[] { new KeyValuePair<Type, object>(typeof(IWebHookReceiverManager), _managerMock.Object) });

            HttpControllerContext controllerContext = new HttpControllerContext()
            {
                Configuration = _config,
                Request = new HttpRequestMessage(),
            };
            _controller = new WebHookReceiversController();
            _controller.ControllerContext = controllerContext;
        }
Пример #2
0
        public WebHookReceiversControllerTests()
        {
            _managerMock = new Mock <IWebHookReceiverManager>();
            _config      = HttpConfigurationMock.Create(new[] { new KeyValuePair <Type, object>(typeof(IWebHookReceiverManager), _managerMock.Object) });

            HttpControllerContext controllerContext = new HttpControllerContext()
            {
                Configuration = _config,
                Request       = new HttpRequestMessage(),
            };

            _controller = new WebHookReceiversController();
            _controller.ControllerContext = controllerContext;
        }
        public WebHookReceiversControllerTests()
        {
            _resolverMock = new Mock<IDependencyResolver>();
            _managerMock = new Mock<IWebHookReceiverManager>();
            _resolverMock.Setup(r => r.GetService(typeof(IWebHookReceiverManager)))
                .Returns(_managerMock.Object)
                .Verifiable();

            _config = new HttpConfiguration();
            _config.DependencyResolver = _resolverMock.Object;
            WebHooksConfig.Initialize(_config);

            HttpControllerContext controllerContext = new HttpControllerContext()
            {
                Configuration = _config,
                Request = new HttpRequestMessage(),
            };
            _controller = new WebHookReceiversController();
            _controller.ControllerContext = controllerContext;
        }