예제 #1
0
		public void CopyToTests()
		{
			int[] starting = new int[3] { 1, 2, 3 };
			Set<int> set = new Set<int>(starting);
			Assert.AreEqual(3, set.Count, "Set should have three items in it.");

			int[] ending = new int[set.Count];
			set.CopyTo(ending, 0);
			Assert.AreEqual(3, ending.Length, "Set should have three items in it.");

			int i = 0;
			foreach (int startInt in starting)
			{
				Assert.AreEqual(startInt, ending[i++], "Set should have same three items in it.");
			}
		}