public void Verify_probe_healthy_condition() { var knowledgeBaseProvider = _provider.GetService <IKnowledgeBaseProvider>(); var probe = new AvailableCpuCoresProbe(knowledgeBaseProvider); NodeSnapshot snapshot = new FakeNodeSnapshot3(5); var result = probe.Execute(snapshot); result.Status.ShouldBe(ProbeResultStatus.Healthy); result.KB.Id.ShouldBe(typeof(AvailableCpuCoresProbe).GetIdentifier()); }
public void Verify_probe_unhealthy_condition() { var knowledgeBaseProvider = _services.GetService <IKnowledgeBaseProvider>(); var probe = new AvailableCpuCoresProbe(knowledgeBaseProvider); NodeSnapshot snapshot = new () { AvailableCoresDetected = 0 }; var result = probe.Execute(snapshot); Assert.Multiple(() => { Assert.AreEqual(ProbeResultStatus.Unhealthy, result.Status); Assert.AreEqual(typeof(AvailableCpuCoresProbe).GetIdentifier(), result.KB.Id); }); }