예제 #1
0
        public void ContainsTest()
        {
            StringEnumList <myEnum> actual = new StringEnumList <myEnum>();

            actual.Add(myEnum.Alpha);
            actual.Add(myEnum.beta);
            actual.Add(myEnum.GAMMA);
            actual.Add(myEnum.DeltaEpsilon);

            Assert.AreEqual(4, actual.Count);

            Assert.IsTrue(actual.Contains(myEnum.Alpha));
            Assert.IsTrue(actual.Contains(myEnum.beta));
            Assert.IsTrue(actual.Contains(myEnum.GAMMA));
            Assert.IsTrue(actual.Contains(myEnum.DeltaEpsilon));
        }
예제 #2
0
        public void CopyToTest()
        {
            StringEnumList <myEnum> actual = new StringEnumList <myEnum>();

            actual.Add(myEnum.DeltaEpsilon);
            actual.Add(myEnum.DeltaEpsilon);
            actual.Add(myEnum.DeltaEpsilon);
            actual.Add(myEnum.DeltaEpsilon);

            myEnum[] l = new myEnum[] { myEnum.Alpha, myEnum.beta, myEnum.GAMMA, myEnum.DeltaEpsilon };

            actual.CopyTo(l, 0);

            Assert.IsTrue(actual.Contains(myEnum.Alpha));
            Assert.IsTrue(actual.Contains(myEnum.beta));
            Assert.IsTrue(actual.Contains(myEnum.GAMMA));
            Assert.IsTrue(actual.Contains(myEnum.DeltaEpsilon));
        }