Esempio n. 1
0
        public override void SetUp()
        {
            base.SetUp();

            var bootstrapper = new AlfredBootstrapper();
            _alfred = bootstrapper.Create();

            _subsystem = new TestSubsystem(Container);
        }
Esempio n. 2
0
        public override void SetUp()
        {
            base.SetUp();

            var bootstrapper = new AlfredBootstrapper();
            _alfred = bootstrapper.Create();
            _subsystem = new TestSubsystem(Container);
            _page = new TestPage(Container);

            _subsystem.AddAutoRegisterPage(_page);
            _alfred.Register(_subsystem);
        }
Esempio n. 3
0
        /// <summary>
        ///     Prepare the test subsystem prior to registration and startup.
        /// </summary>
        /// <param name="testSubsystem"> The test subsystem. </param>
        protected override void PrepareTestSubsystem(TestSubsystem testSubsystem)
        {
            base.PrepareTestSubsystem(testSubsystem);

            // Add all pages we want t o register to the test
            foreach (var page in _testPages)
            {
                testSubsystem.RegisterPages.Add(page);
            }
        }
Esempio n. 4
0
        public override void SetUp()
        {
            base.SetUp();

            var bootstrapper = new AlfredBootstrapper();
            _alfred = bootstrapper.Create();
            _alfred.Console = new SimpleConsole();

            _subsystem = new TestSubsystem(Container);
            _page = new AlfredModuleListPage(Container, "Test Page", "Test");
        }
Esempio n. 5
0
        /// <summary>
        /// Registers the module to the Alfred instance using a test subsystem and simple page.
        /// </summary>
        /// <param name="alfred">The alfred.</param>
        /// <param name="module">The module.</param>
        /// <exception cref="System.ArgumentNullException">alfred, module
        /// </exception>
        private void RegisterTestModule([NotNull] AlfredApplication alfred, [NotNull] AlfredModule module)
        {
            if (alfred == null)
            {
                throw new ArgumentNullException(nameof(alfred));
            }
            if (module == null)
            {
                throw new ArgumentNullException(nameof(module));
            }

            var subsystem = new TestSubsystem(Container);

            var page = new AlfredModuleListPage(Container, "Test Page", "Test");
            subsystem.AddAutoRegisterPage(page);

            alfred.Register(subsystem);

            page.Register(module);
        }
Esempio n. 6
0
        public void OnStartup()
        {
            var bootstrapper = new AlfredBootstrapper();
            _alfred = bootstrapper.Create();

            _page = new AlfredModuleListPage(Container, "Time", "Time");
            _module = new AlfredTimeModule(Container);
            _page.Register(_module);
            _subsystem = new TestSubsystem(Container);
            _subsystem.AddAutoRegisterPage(_page);

            _alfred.Register(_subsystem);
        }