public void TestRoundTrip()
        {
            var credentials = new CredentialCache {
                Logon = "user", Password = "******", AccessToken = string.Empty
            };
            var cache = credentials.ToString();

            Assert.That(cache, Is.Not.Null);
            Assert.That(cache, Is.StringContaining("user"));
            Assert.That(cache, Is.Not.StringContaining("password"));

            var parsed = CredentialCache.FromString(cache);

            Assert.That(parsed, Is.Not.Null);
            Assert.That(parsed.Logon, Is.EqualTo("user"));
            Assert.That(parsed.Password, Is.EqualTo("password"));
            Assert.That(parsed.AccessToken, Is.EqualTo(string.Empty));
        }
 public void FromBlankStringReturnsNull()
 {
     Assert.That(CredentialCache.FromString("   "), Is.Null);
 }
 public void FromEmptyStringReturnsNull()
 {
     Assert.That(CredentialCache.FromString(string.Empty), Is.Null);
 }
 public void FromNullStringReturnsNull()
 {
     Assert.That(CredentialCache.FromString(null), Is.Null);
 }