public ActionResult Result() { int yearVal = int.Parse(Request.Form["year"]); int monthVal = int.Parse(Request.Form["month"]); int dayVal = int.Parse(Request.Form["day"]); DayFind newDayFind = new DayFind(yearVal, monthVal, dayVal); string model = newDayFind.ReturnDayOfWeek() + " is the day of the week based on the date you entered: " + monthVal + "/" + dayVal + "/" + yearVal + "."; return(View("Index", model)); }
public void GetDate_TestInput_Int() { //arrange int testYear = 2018; int testMonth = 2; int testDay = 15; DayFind newDayFind = new DayFind(2018, 2, 15); //act int targetYear = newDayFind.GetYear(); int targetMonth = newDayFind.GetMonth(); int targetDay = newDayFind.GetDay(); //assert Assert.AreEqual(testYear, targetYear); Assert.AreEqual(testMonth, targetMonth); Assert.AreEqual(testDay, targetDay); }