public void DateTimeVar_Negative_Range_Test_SetValue() { //Arrange var variableDateTime = new VariableDateTime(); variableDateTime.Name = "test"; variableDateTime.DateTimeFormat = "MMM dd, yyyy"; variableDateTime.MinDateTime = "Jan 21, 2010"; variableDateTime.MaxDateTime = "Jan 01, 2030"; variableDateTime.InitialDateTime = "Jan 01, 2025"; //Act var result = variableDateTime.SetValue("Jan 31, 2030"); //Assert Assert.AreEqual(false, result); }
public void DateTimeVar_Test_SetValue() { //Arrange var variableDateTime = new VariableDateTime(); variableDateTime.Name = "test"; variableDateTime.DateTimeFormat = "MMM dd, yyyy"; variableDateTime.MinDateTime = "Jan 21, 2010"; variableDateTime.MaxDateTime = "Jan 01, 2030"; variableDateTime.InitialDateTime = "Jan 01, 2025"; //Act var result = variableDateTime.SetValue("May 16, 2019"); //Assert Assert.AreEqual(true, result); Assert.AreEqual("May 16, 2019", variableDateTime.InitialDateTime); }