예제 #1
0
파일: XEnumTests.cs 프로젝트: astorch/xcite
        public void IntOperator()
        {
            int    enumValue = (int)EKinds.StageOne;
            EKinds kind      = (EKinds)enumValue;

            Assert.AreEqual(kind, EKinds.StageOne);
        }
예제 #2
0
파일: XEnumTests.cs 프로젝트: astorch/xcite
        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);
        }