public void StatusResultsBuilderProperties() { using (AmbientClock.Pause()) { StatusCheckerTest checker = new StatusCheckerTest(); StatusResultsBuilder test = new StatusResultsBuilder(checker, new StatusProperty[] { new StatusProperty("Property1", "Value1"), new StatusProperty("Property2", "Value2") }); StatusProperty property = test.FindProperty("Property1"); Assert.AreEqual("Value1", property?.Value); } }
public async Task StatusChecker() { using (AmbientClock.Pause()) { using (StatusCheckerTest test = new StatusCheckerTest()) { StatusResults results = await test.GetStatus(); Assert.AreEqual(results, test.LatestResults); Assert.AreEqual(results, test.History.LastOrDefault()); // the most recent history results should be the last one (history is a FIFO queue) Assert.AreEqual("StatusCheckerTest", test.TargetSystem); await test.BeginStop(); await test.FinishStop(); } } }