コード例 #1
0
        public ReportSuspiciousFactTests()
        {
            var builder   = new StructureMapContainerBuilder();
            var container = builder.Build(new Server.AppSettings());

            container.Inject(Substitute.For <IEventPublisher>());
            container.Inject(Substitute.For <IWebSiteChecker>());
            container.Inject <IEventStore>(container.GetInstance <InMemoryEventStore>());

            _commandSender  = container.GetInstance <ICommandSender>();
            _eventPublisher = container.GetInstance <IEventPublisher>();
            _webSiteChecker = container.GetInstance <IWebSiteChecker>();
            _webSiteChecker.IsOnline(Arg.Any <string>()).Returns(Task.FromResult(true));
            _webSiteChecker.IsOnline(UNREACHABLE_WEB_PAGE).Returns(false);
        }
コード例 #2
0
        protected override IContainer GetApplicationContainer()
        {
            var containerBuilder = new StructureMapContainerBuilder();

            return(containerBuilder.Build(settings));
        }