public int AgeTest01(DateTime birthdate, DateTime comparedate) { int result = DateFC.Age(birthdate, comparedate); return(result); // TODO: add assertions to method DateFCTest.AgeTest01(DateTime, DateTime) }
public int AgeTest(DateTime BirthDate) { int result = DateFC.Age(BirthDate); return(result); // TODO: add assertions to method DateFCTest.AgeTest(DateTime) }
public void Age_GetAgebyCurrentDate_Test() { //Arrange string iDate = "12/08/2010"; DateTime tDate = Convert.ToDateTime(iDate); string expect = "10"; // Act var result = DateFC.Age(tDate).ToString(); //Assert Assert.AreEqual(expect, result, $"Get Age by current date 8, {result}"); }
public void Age_GetAgebyGivenDate_Test() { //Arrange string iDate = "12/08/2005"; DateTime tDate = Convert.ToDateTime(iDate); string compaireDate = "2020/12/08"; DateTime tCompaireDate = Convert.ToDateTime(compaireDate); string expect = "15"; // Act var result = DateFC.Age(tDate, tCompaireDate).ToString(); //Assert Assert.AreEqual(expect, result, $"get Age by given date 15, {result}"); }