/
githubmirror
/
PowerToys
Обзор
Документация
Войти
/
githubmirror
/
PowerToys
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/modules/awake/Awake.ModuleServices.UnitTests/AwakeStateMappingTests.cs
36 строк
1 KB
Clint Rutkas
Add Awake module services unit test seed (#48346)
28 июл 2026, 10:24
Не верифицирован
28 июл 2026, 10:24
837fe46
Код
Авторство
О чём код?
// Copyright (c) Microsoft Corporation // The Microsoft Corporation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. using Microsoft.PowerToys.Settings.UI.Library; using Microsoft.VisualStudio.TestTools.UnitTesting; namespace Awake.ModuleServices.UnitTests; [TestClass] public sealed class AwakeStateMappingTests { [TestMethod] public void CreateState_TimedSettings_ReturnsTimedStateWithDuration() { var settings = new AwakeSettings { Properties = { Mode = AwakeMode.TIMED, KeepDisplayOn = true, IntervalHours = 1, IntervalMinutes = 30, ExpirationDateTime = new DateTimeOffset(2030, 1, 2, 3, 4, 5, TimeSpan.Zero), }, }; var state = AwakeService.CreateState(isRunning: true, settings); Assert.IsTrue(state.IsRunning); Assert.AreEqual(AwakeStateMode.Timed, state.Mode); Assert.IsTrue(state.KeepDisplayOn); Assert.AreEqual(TimeSpan.FromMinutes(90), state.Duration); Assert.IsNull(state.Expiration); } }