public void TestAddNull() { RangeTypeCollection rangeTypeCollection = new RangeTypeCollection(); Assert.AreEqual(0, rangeTypeCollection.Count); rangeTypeCollection.Add(null); Assert.AreEqual(0, rangeTypeCollection.Count); }
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); } }
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); }
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]); }
public void TestToArrayEmptyCollection() { RangeTypeCollection rangeTypeCollection = new RangeTypeCollection(); RangeTypes[] rangeTypes = rangeTypeCollection.ToArray(); Assert.AreEqual(0, rangeTypes.Length); }
public void TestContains() { RangeTypeCollection rangeTypeCollection = new RangeTypeCollection(); rangeTypeCollection.Add(RangeTypes.Paragraph); Assert.IsTrue(rangeTypeCollection.Contains(RangeTypes.Paragraph)); Assert.IsFalse(rangeTypeCollection.Contains(RangeTypes.Comment)); }