public void ConvertEnumTest() { object value = "Third"; var type = ConvertTool.ConvertEnum <Quarters>(value, Quarters.First); Assert.AreEqual(Quarters.Third, type); }
/// <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)); }
/// <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)); }