Ejemplo n.º 1
0
        public void IntOperator()
        {
            int    enumValue = (int)EKinds.StageOne;
            EKinds kind      = (EKinds)enumValue;

            Assert.AreEqual(kind, EKinds.StageOne);
        }
Ejemplo n.º 2
0
        public void TryParse()
        {
            bool match   = EKinds.TryParse("StageOne", out EKinds matchValue);
            bool noMatch = EKinds.TryParse("stageThree", out EKinds noMatchValue);

            Assert.IsTrue(match);
            Assert.AreEqual(EKinds.StageOne, matchValue);

            Assert.IsFalse(noMatch);
            Assert.AreEqual(EKinds.Default, noMatchValue);
        }