コード例 #1
0
		public void TestAddNull()
		{
			RangeTypeCollection rangeTypeCollection = new RangeTypeCollection();
			Assert.AreEqual(0, rangeTypeCollection.Count);
			rangeTypeCollection.Add(null);
			Assert.AreEqual(0, rangeTypeCollection.Count);
		}
コード例 #2
0
		public void TestAddByName()
		{
			RangeTypeCollection rangeTypeCollection = new RangeTypeCollection();
			for(RangeTypes rangeType = RangeTypes.None; rangeType < RangeTypes.InvalidRangeType; ++rangeType)
			{
				rangeTypeCollection.Add(rangeType.ToString());
				Assert.AreEqual((int)rangeType, rangeTypeCollection.Count);
			}
		}
コード例 #3
0
		public void TestAddInvalidRangeType()
		{
			RangeTypeCollection rangeTypeCollection = new RangeTypeCollection();
			Assert.AreEqual(0, rangeTypeCollection.Count);
			rangeTypeCollection.Add(RangeTypes.None);
			Assert.AreEqual(0, rangeTypeCollection.Count);
			rangeTypeCollection.Add(RangeTypes.InvalidRangeType);
			Assert.AreEqual(0, rangeTypeCollection.Count);
			rangeTypeCollection.Add((RangeTypes)99);
			Assert.AreEqual(0, rangeTypeCollection.Count);
			rangeTypeCollection.Add("InvalidRangeType");
			Assert.AreEqual(0, rangeTypeCollection.Count);
		}
コード例 #4
0
		public void TestToArray()
		{
			RangeTypeCollection rangeTypeCollection = new RangeTypeCollection();
			rangeTypeCollection.Add(RangeTypes.Paragraph);
			rangeTypeCollection.Add(RangeTypes.Comment);
			Assert.AreEqual(2, rangeTypeCollection.Count);
			RangeTypes[] rangeTypes = rangeTypeCollection.ToArray();
			Assert.AreEqual(2, rangeTypes.Length);
			Assert.AreEqual(RangeTypes.Paragraph, rangeTypes[0]);
			Assert.AreEqual(RangeTypes.Comment, rangeTypes[1]);
		}
コード例 #5
0
		public void TestToArrayEmptyCollection()
		{
			RangeTypeCollection rangeTypeCollection = new RangeTypeCollection();
			RangeTypes[] rangeTypes = rangeTypeCollection.ToArray();
			Assert.AreEqual(0, rangeTypes.Length);
		}
コード例 #6
0
		public void TestContains()
		{
			RangeTypeCollection rangeTypeCollection = new RangeTypeCollection();
			rangeTypeCollection.Add(RangeTypes.Paragraph);
			Assert.IsTrue(rangeTypeCollection.Contains(RangeTypes.Paragraph));
			Assert.IsFalse(rangeTypeCollection.Contains(RangeTypes.Comment));
		}