public void ContainsReturnsFalseForAllowListItemNotInTheList()
        {
            var allowList = new AllowList();

            allowList.Add("Scunthorpe");
            allowList.Add("Penistone");

            Assert.IsFalse(allowList.Contains("Wibble"));
            Assert.IsFalse(allowList.Contains("Gobble"));
        }
        public void ContainsReturnsTrueForAllowListItemInTheListWithMixedCase()
        {
            var allowList = new AllowList();

            allowList.Add("Scunthorpe");
            allowList.Add("Penistone");

            Assert.IsTrue(allowList.Contains("ScunThorpe"));
            Assert.IsTrue(allowList.Contains("PeniStone"));
        }
        public void RemoveMixedCaseEntryFromTheAllowList()
        {
            var allowList = new AllowList();

            allowList.Add("Scunthorpe");
            allowList.Add("Penistone");

            Assert.AreEqual(2, allowList.Count);

            allowList.Remove("ScUnThOrPe");

            Assert.AreEqual(1, allowList.Count);
            Assert.IsFalse(allowList.Contains("Scunthorpe"));
            Assert.IsTrue(allowList.Contains("Penistone"));
        }
        public void AddInsertsLowercaseItemIntoTheAllowList()
        {
            var allowList = new AllowList();

            allowList.Add("Scunthorpe");

            Assert.IsTrue(allowList.Contains("scunthorpe"));
        }
        public void ContainsThrowsArgumentNullExceptionIfInputStringIsNullOrEmpty()
        {
            var allowList = new AllowList();

            allowList.Contains("");
        }
示例#6
0
 //メソッド
 //AllowListの操作
 internal bool IsContainAllowList(string domain)
 {
     return(AllowList.Contains(domain));
 }