/// <summary> /// 根據(jù)時間段獲取每星期X的總數(shù) /// </summary> /// <param name="beginDateTime">開始時間</param> /// <param name="endDateTime">結(jié)束時間</param> /// <param name="week">星期幾 0:星期日</param> /// <returns></returns> public static int GetWeekCount(DateTime beginDateTime, DateTime endDateTime, List<DayOfWeek> weekList) { } 如何讓這個單元測試相等呀? List<DayOfWeek> list = new List<DayOfWeek>(); list.Add(DayOfWeek.Tuesday); list.Add(DayOfWeek.Wednesday);//從2012-5-1日到2012-5-31 日有10天符合星期二或星期三 TestHelper.Test(DateTimeHelper.GetWeekCount(DateTime.Parse("2012-5-1"), DateTime.Parse("2012-5-31"), list) == 10);
請問如何獲取一個時間段內(nèi)有多少個星期X
婷婷同學(xué)_
2018-08-02 05:06:09