示例#1
0
        public void ConvertEnumTest()
        {
            object value = "Third";

            var type = ConvertTool.ConvertEnum <Quarters>(value, Quarters.First);

            Assert.AreEqual(Quarters.Third, type);
        }
示例#2
0
        /// <summary>
        /// 지정된 월이 속한 분기
        /// </summary>
        /// <param name="month">조회할 월</param>
        /// <returns>월이 속한 분기</returns>
        public static Quarters GetQuarter(this int month)
        {
            // Bug Fix at 2009-09-09

            int quarter = (month - 1) / 3 + 1;

            return(ConvertTool.ConvertEnum(quarter, Quarters.First));
        }
示例#3
0
        /// <summary>
        /// 지정된 월이 속한 분기
        /// </summary>
        /// <param name="month">조회할 월</param>
        /// <returns>월이 속한 분기</returns>
        public static QuarterKind QuarterOf(this int month)
        {
            var quarter = (month - 1) / TimeSpec.MonthsPerQuarter + 1;

            return(ConvertTool.ConvertEnum(quarter, QuarterKind.First));
        }