コード例 #1
0
        /// <summary>
        ///     Initializes a new instance of the <see cref="AlfredSubsystem" /> class.
        /// </summary>
        /// <exception cref="ArgumentNullException">
        ///     Thrown when one or more required arguments are null.
        /// </exception>
        /// <param name="container"> The container. </param>
        public AlfredCoreSubsystem([NotNull] IObjectContainer container)
            : base(container)
        {
            if (container == null) { throw new ArgumentNullException(nameof(container)); }

            _controlPage = new AlfredModuleListPage(container, ControlPageName, "Core");

            // Instantiate the modules
            _powerModule = new AlfredPowerModule(container);
            _timeModule = new AlfredTimeModule(container);
            _systemsModule = new AlfredSubsystemListModule(container);
            _pagesModule = new AlfredPagesListModule(container);
        }
コード例 #2
0
        public void AtInitialStateInitializeIsVisible()
        {
            // Doing this again here to illustrate creation / configuration order more clearly
            var bootstrapper = new AlfredBootstrapper();
            _alfred = bootstrapper.Create();
            _module = new AlfredPowerModule(Container);

            RegisterTestModule(_alfred, _module);

            Assert.IsNotNull(_module.AlfredInstance, "Alfred was not set");
            Assert.IsTrue(_module.InitializeButton.IsVisible, "Initialize button was not visible while offline.");
            Assert.IsNotNull(_module.Widgets, "_module.Widgets was null");
            Assert.IsTrue(_module.Widgets.Contains(_module.InitializeButton),
                          "The Initialize button was not part of the UI while offline");
        }
コード例 #3
0
        public override void SetUp()
        {
            base.SetUp();

            var bootstrapper = new AlfredBootstrapper();
            _alfred = bootstrapper.Create();
            _module = new AlfredPowerModule(Container);

            RegisterTestModule(_alfred, _module);
        }
コード例 #4
0
        public void CoreModuleHasNoProviderText()
        {
            var bootstrapper = new AlfredBootstrapper(Container);
            _alfred = bootstrapper.Create();
            _module = new AlfredPowerModule(Container);

            var text = _module.AlfredStatusWidget.Text;
            Assert.IsNotNull(text, "Widget text was null");
            Assert.IsTrue(text.EndsWith("has not been set"),
                          $"Component did not indicate that Alfred was not set. Instead indicated: {text}");
        }