コード例 #1
0
        public void GetPNDPasswords_ContainsResponse_ContainPassword()
        {
            // Arrange
            HaveIBeenPwndRangeResponse response = HaveIBeenPwndRangeResponseStubs.SampleResponse;
            string prefix = "36DEB";

            // Act
            IEnumerable <PNDPassword> passwords = response.GetPNDPasswords(prefix);

            // Assert
            Assert.IsTrue(passwords.All(password => !string.IsNullOrEmpty(password.SHA1Password)));
        }
コード例 #2
0
        public void GetPNDPasswords_ContainsResponse_ReturnsPNDPasswords()
        {
            // Arrange
            HaveIBeenPwndRangeResponse response = HaveIBeenPwndRangeResponseStubs.SampleResponse;
            string prefix = "36DEB";

            // Act
            IEnumerable <PNDPassword> passwords = response.GetPNDPasswords(prefix);

            // Assert
            Assert.IsTrue(passwords.Any());
        }
コード例 #3
0
        public void GetPNDPasswords_ContainsResponse_ContainCount()
        {
            // Arrange
            HaveIBeenPwndRangeResponse response = HaveIBeenPwndRangeResponseStubs.SampleResponse;
            string prefix = "36DEB";

            // Act
            IEnumerable <PNDPassword> passwords = response.GetPNDPasswords(prefix);

            // Assert
            Assert.IsTrue(passwords.All(password => password.PNDCount != null));
        }
コード例 #4
0
        public void GetPNDPasswords_EmptyResponse_ReturnsEmptyArray()
        {
            // Arrange
            HaveIBeenPwndRangeResponse response = HaveIBeenPwndRangeResponseStubs.EmptyResponse;
            string prefix = "36DEB";

            // Act
            IEnumerable <PNDPassword> passwords = response.GetPNDPasswords(prefix);

            // Assert
            Assert.IsFalse(passwords.Any());
        }