public void HostEntry_AddDifferenceEmpty() { HostEntry he = new HostEntry("demo.de", "https"); he.SetIP("1.1.1.1"); he.SetRanking("C"); he.SetFingerPrintCert("SHA1"); he.SetExpirationDate(DateTime.Now.ToLongDateString()); he.AddDifference(null, "b"); he.AddDifference("a", null); Assert.IsTrue(he.Differences.Count == 0); }
/// <summary> /// This method adds further notes for the 'Recent outcome' list on the UI. /// </summary> private HostEntry addMetaNotes(Analyze a, HostEntry host) { try { host.AddDifference("General message", a.endpoints[0].statusMessage); host.AddDifference("Detailed message", a.endpoints[0].statusDetailsMessage); } catch (Exception) { host.AddDifference("Error", a.Errors[0].message); host.AddDifference("App", "This entry will be treated as unchanged."); } return host; }