protected void btnTest_OnClick(object sender, EventArgs e) { DateTime inpDateTime = DateTime.Parse(txtInputDateTime.Text); DateTime rounDateTime = Round15.Round(inpDateTime, TimeSpan.FromMinutes(15)); lblResult.Text = rounDateTime.ToString("yyyy-MM-dd h:mm"); }
public void Round15TestMethod() { List <DateTime> actualTestDataList = new List <DateTime>(); foreach (var curDateTime in _inputTestDataList) { actualTestDataList.Add(Round15.Round(curDateTime, _15MinutTimeSpan)); } CollectionAssert.AreEqual(_expectedTestDataList, actualTestDataList); }