public void UserStatus_WhenUserMustRest_ReturnsTired(IRestingMonitor restingMonitor)
        {
            if (restingMonitor is null)
            {
                throw new System.ArgumentNullException(nameof(restingMonitor));
            }

            restingMonitor.MustRest.Returns(true);

            using var sut = new TrayIconModel(restingMonitor);

            Assert.Equal(UserStatus.Tired, sut.LastStatus);
        }
示例#2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="TrayIconView"/> class.
        /// </summary>
        /// <param name="restingMonitor">
        /// Dependency. Service that monitors the working and resting of users.
        /// </param>
        public TrayIconView(IRestingMonitor restingMonitor)
        {
            InitializeComponent();

            var trayIconModel = new TrayIconModel(restingMonitor);

            components.Add(trayIconModel);

#pragma warning disable CA2000 // Dispose objects before losing scope

            // TODO: inject Settings
            var trayIconPresenter = new TrayIconPresenter(Settings.Default, this, trayIconModel);
            components.Add(trayIconPresenter);

#pragma warning restore CA2000 // Dispose objects before losing scope
        }