コード例 #1
0
        public void AsEnumNegativeTest()
        {
            AltType defaultValue = AltType.Altitude;
            string  value        = "Magnitude";
            AltType actual       = StringExtensions.AsEnum <AltType>(value, defaultValue);

            Assert.AreEqual(defaultValue, actual);
        }
コード例 #2
0
        public void AsEnumTest()
        {
            AltType defaultValue = AltType.Altitude;
            AltType expected     = AltType.Depth;
            string  value        = Convert.ToString(expected, CultureInfo.InvariantCulture);
            AltType actual       = StringExtensions.AsEnum <AltType>(value, defaultValue);

            Assert.AreEqual(expected, actual);
        }