public async Task GetBreach_WhenCalledWithUnknownSite_ReturnsNull() { // Arrange IHaveIBeenPwnedClient client = new HaveIBeenPwnedClient(); // Act Breach breach = await client.GetBreach("DOES NOT EXIST"); // Assert Assert.IsNull(breach); }
public async Task GetBreach_WhenCalledWithBreachedSite_ReturnsBreachDetails() { // Arrange IHaveIBeenPwnedClient client = new HaveIBeenPwnedClient(); // Act Breach breach = await client.GetBreach("Adobe"); // Assert Assert.AreEqual("Adobe", breach.Name); Assert.AreEqual("In October 2013, 153 million Adobe accounts were breached with each containing an internal ID, username, email, <em>encrypted</em> password and a password hint in plain text. The password cryptography was poorly done and <a href=\"http://stricture-group.com/files/adobe-top100.txt\" target=\"_blank\" rel=\"noopener\">many were quickly resolved back to plain text</a>. The unencrypted hints also <a href=\"http://www.troyhunt.com/2013/11/adobe-credentials-and-serious.html\" target=\"_blank\" rel=\"noopener\">disclosed much about the passwords</a> adding further to the risk that hundreds of millions of Adobe customers already faced.", breach.Description); }