示例#1
0
        public void Contains_file3_False()
        {
            var collection = new CustomWordListCollection();

            collection.Add("file1.txt");
            collection.Add("file2.txt");
            Assert.IsFalse(collection.Contains("file3.txt"));
        }
示例#2
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);
 }
示例#4
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);
        }
示例#5
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);
        }
示例#6
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);
        }
 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 Contains_file3_False()
 {
   var collection = new CustomWordListCollection();
   collection.Add("file1.txt");
   collection.Add("file2.txt");
   Assert.IsFalse(collection.Contains("file3.txt"));
 }
 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 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);
 }