Example #1
0
 public void TestBasicAdddressCollectionCreate()
 {
     DirectAddressCollection coll = new DirectAddressCollection();
     Assert.False(coll.IsTrusted());
     Assert.Equal<string>("", coll.ToString());
     Assert.False(coll.IsTrusted(TrustEnforcementStatus.Failed));
     Assert.True(coll.GetCertificates().Count == 0);
     Assert.True(coll.Certificates.Count() == 0);
     Assert.True(coll.GetUntrusted().Count() == 0);
     Assert.True(coll.GetTrusted().Count() == 0);
     Assert.DoesNotThrow(() => coll.RemoveUntrusted());
 }
Example #2
0
        public void TestBasicAdddressCollectionCreate()
        {
            DirectAddressCollection coll = new DirectAddressCollection();

            Assert.False(coll.IsTrusted());
            Assert.Equal <string>("", coll.ToString());
            Assert.False(coll.IsTrusted(TrustEnforcementStatus.Failed));
            Assert.True(coll.GetCertificates().Count == 0);
            Assert.True(coll.Certificates.Count() == 0);
            Assert.True(coll.GetUntrusted().Count() == 0);
            Assert.True(coll.GetTrusted().Count() == 0);
            Assert.Null(Record.Exception(() => coll.RemoveUntrusted()));
        }
Example #3
0
        public void TestAddressCollectionIsTrustedExplicitStatus()
        {
            DirectAddressCollection coll = BasicCollection();

            // should be able to define a custom floor for trust
            Assert.True(coll.IsTrusted(TrustEnforcementStatus.Failed));
        }
Example #4
0
        public void TestAddressCollectionIsTrustedMixedStatus()
        {
            //Mixed trusted and untrusted should be untrusted
            DirectAddressCollection coll = BasicCollection();

            Assert.False(coll.IsTrusted());
        }
Example #5
0
        public void TestAddressCollectionIsTrustedAllTrusted()
        {
            DirectAddressCollection coll = BasicCollection();

            foreach (DirectAddress addr in coll)
            {
                addr.Status = TrustEnforcementStatus.Success;
            }
            //All trusted addresses should be trusted
            Assert.True(coll.IsTrusted());
        }