public void TestPowerPlanShouldNotChange() { var userPlan = PowerManagementHelper.CurrentPlan; var logger = new OutputLogger(Output); var powerManagementApplier = new PowerManagementApplier(logger); powerManagementApplier.ApplyPerformancePlan(PowerManagementApplier.Map(PowerPlan.UserPowerPlan)); Assert.Equal(userPlan.ToString(), PowerManagementHelper.CurrentPlan.ToString()); powerManagementApplier.Dispose(); Assert.Equal(userPlan, PowerManagementHelper.CurrentPlan); }
public void TestSettingAndRevertingBackGuid() { var userPlan = PowerManagementHelper.CurrentPlan; var logger = new OutputLogger(Output); var powerManagementApplier = new PowerManagementApplier(logger); powerManagementApplier.ApplyPerformancePlan(PowerManagementApplier.Map(PowerPlan.HighPerformance)); Assert.Equal(HighPerformancePlanGuid, PowerManagementHelper.CurrentPlan.ToString()); Assert.Equal("High performance", PowerManagementHelper.CurrentPlanFriendlyName); powerManagementApplier.Dispose(); Assert.Equal(userPlan, PowerManagementHelper.CurrentPlan); }