public void ResourceShouldBeStopped() { // set the time and the timezone to work with DateTime timeReference = new DateTime(2021, 07, 02, 21, 0, 0); // create the tags for the resource group and the Dictionary <string, string> groupTags = new Dictionary <string, string>(); Dictionary <string, string> resourceTags = new Dictionary <string, string>(); PowerSchedule powerSchedule = new PowerSchedule( data.settings, data.timeZones, data.logger, timeReference, groupTags, resourceTags, POWER_STATE, REGION ); // ensure that the resource should be running now powerSchedule.SetTimeZone(); powerSchedule.PermittedToRunDay(); powerSchedule.ShouldBeRunning(); Assert.True(powerSchedule.StopResource()); }
public void ResourcePermittedToRunMountainTime() { string TEST_TIMEZONE_ID = "Mountain Standard Time"; // set the time and the timezone to work with DateTime timeReference = new DateTime(2021, 07, 03, 0, 1, 0); // create the tags for the resource group and the Dictionary <string, string> groupTags = new Dictionary <string, string>(); Dictionary <string, string> resourceTags = new Dictionary <string, string>(); // Add the tag in to state the timezone that should be used resourceTags.Add("TIMEZONE", TEST_TIMEZONE_ID); PowerSchedule powerSchedule = new PowerSchedule( data.settings, data.timeZones, data.logger, timeReference, groupTags, resourceTags, POWER_STATE, REGION ); // ensure that the resource should be running now powerSchedule.SetTimeZone(); powerSchedule.PermittedToRunDay(); Assert.True(powerSchedule.PermittedToRunOnDay); }