示例#1
0
        public void IsReadOnly_SelfBuilt_IsFalse()
        {
            var configCollection = new CustomWordListCollection();
            var collection       = (ICollection <string>)configCollection;

            Assert.IsFalse(collection.IsReadOnly);
        }
示例#2
0
        public void CopyTo_ArrayIndexIsNegative_ExceptionThrown()
        {
            var collection = new CustomWordListCollection();

            string[] array = new string[1];
            collection.CopyTo(array, -1);
        }
示例#3
0
        public void Contains_file3_False()
        {
            var collection = new CustomWordListCollection();

            collection.Add("file1.txt");
            collection.Add("file2.txt");
            Assert.IsFalse(collection.Contains("file3.txt"));
        }
示例#4
0
        public void CustomWordLists_RoundTripValue()
        {
            var section    = new PasswordValidationSection();
            var collection = new CustomWordListCollection();

            Assert.AreNotSame(collection, section.CustomWordLists);
            section.CustomWordLists = collection;
            Assert.AreSame(collection, section.CustomWordLists);
        }
示例#5
0
        public void CopyTo_DestinationOverflow_ExceptionThrown()
        {
            var collection = new CustomWordListCollection();

            collection.Add("file1.txt");
            collection.Add("file2.txt");
            string[] array = new string[1];
            collection.CopyTo(array, 0);
        }
 public void Clear_SelfBuilt_ResetsToEmpty()
 {
   CustomWordListCollection collection = new CustomWordListCollection();
   Assert.AreEqual(0, collection.Count);
   collection.Add("File1.txt");
   collection.Add("File2.txt");
   Assert.AreEqual(2, collection.Count);
   collection.Clear();
   Assert.AreEqual(0, collection.Count);
 }
示例#7
0
        public void InterfaceCustomLists_RoundtripValue()
        {
            var section = new PasswordValidationSection();
            IPasswordValidationSettings iSection = section;
            var collection = new CustomWordListCollection();

            Assert.AreNotSame(collection, iSection.CustomWordLists);
            section.CustomWordLists = collection;
            Assert.AreSame(collection, iSection.CustomWordLists);
        }
示例#8
0
        public void Clear_SelfBuilt_ResetsToEmpty()
        {
            CustomWordListCollection collection = new CustomWordListCollection();

            Assert.AreEqual(0, collection.Count);
            collection.Add("File1.txt");
            collection.Add("File2.txt");
            Assert.AreEqual(2, collection.Count);
            collection.Clear();
            Assert.AreEqual(0, collection.Count);
        }
示例#9
0
        public void Remove_SelfBuilt_ItemIsRemoved()
        {
            CustomWordListCollection collection = new CustomWordListCollection();

            collection.Add("file1.txt");
            collection.Add("file2.txt");
            Assert.AreEqual(2, collection.Count);
            bool result = collection.Remove("file1.txt");

            Assert.IsTrue(result);
            Assert.AreEqual(1, collection.Count);
        }
示例#10
0
        public void Remove_SelfBuiltRemoveNonExistantItem_RemoveReturnsFalse()
        {
            CustomWordListCollection collection = new CustomWordListCollection();

            collection.Add("file1.txt");
            collection.Add("file2.txt");
            Assert.AreEqual(2, collection.Count);
            bool result = collection.Remove("file3.txt");

            Assert.IsFalse(result);
            Assert.AreEqual(2, collection.Count);
        }
示例#11
0
        public void CopyTo_NoArrayPassed_ExceptionThrown()
        {
            var collection = new CustomWordListCollection();

            collection.CopyTo(null, 0);
        }
 public void CopyTo_ArrayIndexIsNegative_ExceptionThrown()
 {
   var collection = new CustomWordListCollection();
   string[] array = new string[1];
   collection.CopyTo(array, -1);
 }
 public void CopyTo_DestinationOverflow_ExceptionThrown()
 {
   var collection = new CustomWordListCollection();
   collection.Add("file1.txt");
   collection.Add("file2.txt");
   string[] array = new string[1];
   collection.CopyTo(array, 0);
 }
 public void Contains_file3_False()
 {
   var collection = new CustomWordListCollection();
   collection.Add("file1.txt");
   collection.Add("file2.txt");
   Assert.IsFalse(collection.Contains("file3.txt"));
 }
 public void IsReadOnly_SelfBuilt_IsFalse()
 {
   var configCollection = new CustomWordListCollection();
   var collection = (ICollection<string>)configCollection;
   Assert.IsFalse(collection.IsReadOnly);
 }
 public void CopyTo_NoArrayPassed_ExceptionThrown()
 {
   var collection = new CustomWordListCollection();
   collection.CopyTo(null, 0);
 }
 public void CustomWordLists_RoundTripValue()
 {
   var section = new PasswordValidationSection();
   var collection = new CustomWordListCollection();
   Assert.AreNotSame(collection, section.CustomWordLists);
   section.CustomWordLists = collection;
   Assert.AreSame(collection, section.CustomWordLists);
 }
 public void Remove_SelfBuilt_ItemIsRemoved()
 {
   CustomWordListCollection collection = new CustomWordListCollection();
   collection.Add("file1.txt");
   collection.Add("file2.txt");
   Assert.AreEqual(2, collection.Count);
   bool result = collection.Remove("file1.txt");
   Assert.IsTrue(result);
   Assert.AreEqual(1, collection.Count);
 }
 public void InterfaceCustomLists_RoundtripValue()
 {
   var section = new PasswordValidationSection();
   IPasswordValidationSettings iSection = section;
   var collection = new CustomWordListCollection();
   Assert.AreNotSame(collection, iSection.CustomWordLists);
   section.CustomWordLists = collection;
   Assert.AreSame(collection, iSection.CustomWordLists);
 }
 public void Remove_SelfBuiltRemoveNonExistantItem_RemoveReturnsFalse()
 {
   CustomWordListCollection collection = new CustomWordListCollection();
   collection.Add("file1.txt");
   collection.Add("file2.txt");
   Assert.AreEqual(2, collection.Count);
   bool result = collection.Remove("file3.txt");
   Assert.IsFalse(result);
   Assert.AreEqual(2, collection.Count);
 }