public void IsReadOnly_SelfBuilt_IsFalse()
        {
            var configCollection = new StandardWordListCollection();
            var collection       = (ICollection <StandardWordList>)configCollection;

            Assert.IsFalse(collection.IsReadOnly);
        }
        public void CopyTo_ArrayIndexIsNegative_ExceptionThrown()
        {
            var collection = new StandardWordListCollection();

            StandardWordList[] array = new StandardWordList[1];
            collection.CopyTo(array, -1);
        }
示例#3
0
        public void StandardWordLists_RoundTripValue()
        {
            var section    = new PasswordValidationSection();
            var collection = new StandardWordListCollection();

            Assert.AreNotSame(collection, section.StandardWordLists);
            section.StandardWordLists = collection;
            Assert.AreSame(collection, section.StandardWordLists);
        }
        public void CopyTo_DestinationOverflow_ExceptionThrown()
        {
            var collection = new StandardWordListCollection();

            collection.Add(StandardWordList.FemaleNames);
            collection.Add(StandardWordList.MaleNames);
            StandardWordList[] array = new StandardWordList[1];
            collection.CopyTo(array, 0);
        }
 public void Clear_SelfBuilt_ResetsToEmpty()
 {
   StandardWordListCollection collection = new StandardWordListCollection();
   Assert.AreEqual(0, collection.Count);
   collection.Add(StandardWordList.FemaleNames);
   collection.Add(StandardWordList.MaleNames);
   Assert.AreEqual(2, collection.Count);
   collection.Clear();
   Assert.AreEqual(0, collection.Count);
 }
示例#6
0
        public void InterfaceStandardWordLists_RoundtripValue()
        {
            var section = new PasswordValidationSection();
            IPasswordValidationSettings iSection = section;
            var collection = new StandardWordListCollection();

            Assert.AreNotSame(collection, iSection.StandardWordLists);
            section.StandardWordLists = collection;
            Assert.AreSame(collection, iSection.StandardWordLists);
        }
        public void Clear_SelfBuilt_ResetsToEmpty()
        {
            StandardWordListCollection collection = new StandardWordListCollection();

            Assert.AreEqual(0, collection.Count);
            collection.Add(StandardWordList.FemaleNames);
            collection.Add(StandardWordList.MaleNames);
            Assert.AreEqual(2, collection.Count);
            collection.Clear();
            Assert.AreEqual(0, collection.Count);
        }
示例#8
0
        public void StandardWordLists_AllWordsConfig_FullComplimentOfWordLists()
        {
            var config = GetAllWordsConfig();
            StandardWordListCollection standardWordListCollection = config.StandardWordLists;

            Assert.AreEqual(4, standardWordListCollection.Count);

            Assert.IsTrue(standardWordListCollection.Contains(StandardWordList.FemaleNames));
            Assert.IsTrue(standardWordListCollection.Contains(StandardWordList.MaleNames));
            Assert.IsTrue(standardWordListCollection.Contains(StandardWordList.MostCommon500Passwords));
            Assert.IsTrue(standardWordListCollection.Contains(StandardWordList.Surnames));
        }
        public void Remove_SelfBuilt_ItemIsRemoved()
        {
            StandardWordListCollection collection = new StandardWordListCollection();

            collection.Add(StandardWordList.FemaleNames);
            collection.Add(StandardWordList.MaleNames);
            Assert.AreEqual(2, collection.Count);
            bool result = collection.Remove(StandardWordList.MaleNames);

            Assert.IsTrue(result);
            Assert.AreEqual(1, collection.Count);
        }
        public void Remove_SelfBuiltRemoveNonExistantItem_RemoveReturnsFalse()
        {
            StandardWordListCollection collection = new StandardWordListCollection();

            collection.Add(StandardWordList.FemaleNames);
            collection.Add(StandardWordList.MaleNames);
            Assert.AreEqual(2, collection.Count);
            bool result = collection.Remove(StandardWordList.Surnames);

            Assert.IsFalse(result);
            Assert.AreEqual(2, collection.Count);
        }
 public void Remove_SelfBuiltRemoveNonExistantItem_RemoveReturnsFalse()
 {
   StandardWordListCollection collection = new StandardWordListCollection();
   collection.Add(StandardWordList.FemaleNames);
   collection.Add(StandardWordList.MaleNames);
   Assert.AreEqual(2, collection.Count);
   bool result = collection.Remove(StandardWordList.Surnames);
   Assert.IsFalse(result);
   Assert.AreEqual(2, collection.Count);
 }
 public void CopyTo_ArrayIndexIsNegative_ExceptionThrown()
 {
   var collection = new StandardWordListCollection();
   StandardWordList[] array = new StandardWordList[1];
   collection.CopyTo(array, -1);
 }
 public void CopyTo_DestinationOverflow_ExceptionThrown()
 {
   var collection = new StandardWordListCollection();
   collection.Add(StandardWordList.FemaleNames);
   collection.Add(StandardWordList.MaleNames);
   StandardWordList[] array = new StandardWordList[1];
   collection.CopyTo(array, 0);
 }
 public void IsReadOnly_SelfBuilt_IsFalse()
 {
   var configCollection = new StandardWordListCollection();
   var collection = (ICollection<StandardWordList>) configCollection;
   Assert.IsFalse(collection.IsReadOnly);
 }
 public void Remove_SelfBuilt_ItemIsRemoved()
 {
   StandardWordListCollection collection = new StandardWordListCollection();
   collection.Add(StandardWordList.FemaleNames);
   collection.Add(StandardWordList.MaleNames);
   Assert.AreEqual(2, collection.Count);
   bool result = collection.Remove(StandardWordList.MaleNames);
   Assert.IsTrue(result);
   Assert.AreEqual(1, collection.Count);
 }
        public void CopyTo_NoArrayPassed_ExceptionThrown()
        {
            var collection = new StandardWordListCollection();

            collection.CopyTo(null, 0);
        }
 public void InterfaceStandardWordLists_RoundtripValue()
 {
   var section = new PasswordValidationSection();
   IPasswordValidationSettings iSection = section;
   var collection = new StandardWordListCollection();
   Assert.AreNotSame(collection, iSection.StandardWordLists);
   section.StandardWordLists = collection;
   Assert.AreSame(collection, iSection.StandardWordLists);
 }
 public void StandardWordLists_RoundTripValue()
 {
   var section = new PasswordValidationSection();
   var collection = new StandardWordListCollection();
   Assert.AreNotSame(collection, section.StandardWordLists);
   section.StandardWordLists = collection;
   Assert.AreSame(collection, section.StandardWordLists);
 }
 public void CopyTo_NoArrayPassed_ExceptionThrown()
 {
   var collection = new StandardWordListCollection();
   collection.CopyTo(null, 0);
 }