public void TestSearchEmpty() { SearchModel<Status> model = new SearchModel<Status>(); SearchValidationResult res = model.IsValidSearchCombination(); Assert.False(res.IsValid); Assert.AreEqual(StringResource.NO_VALUES_TO_SEARCH, res.Description); }
public void TestSearchEmpty() { SearchModel <Status> model = new SearchModel <Status>(); SearchValidationResult res = model.IsValidSearchCombination(); Assert.False(res.IsValid); Assert.AreEqual(StringResource.NO_VALUES_TO_SEARCH, res.Description); }
public void TestSearchMissingStartTime() { DateTime date = DateTime.Now; SearchModel<Status> model = new SearchModel<Status>() { Status = Status.hold, End = date.AddMinutes(5) }; SearchValidationResult res = model.IsValidSearchCombination(); Assert.False(res.IsValid); Assert.AreEqual(StringResource.START_VALUE_SHOULD_BE_SPECIFIED, res.Description); }
public void TestSearchMissingEndTimeForPaging() { DateTime date = DateTime.Now; SearchModel<Status> model = new SearchModel<Status>() { Start = date, Paging = 10 }; SearchValidationResult res = model.IsValidSearchCombination(); Assert.False(res.IsValid); Assert.AreEqual(StringResource.START_END_VALUES_SHOULD_BE_SPECIFIED, res.Description); }
public void TestSearchMissingEndTimeForPaging() { DateTime date = DateTime.Now; SearchModel <Status> model = new SearchModel <Status>() { Start = date, Paging = 10 }; SearchValidationResult res = model.IsValidSearchCombination(); Assert.False(res.IsValid); Assert.AreEqual(StringResource.START_END_VALUES_SHOULD_BE_SPECIFIED, res.Description); }
public void TestSearchMissingStartTime() { DateTime date = DateTime.Now; SearchModel <Status> model = new SearchModel <Status>() { Status = Status.hold, End = date.AddMinutes(5) }; SearchValidationResult res = model.IsValidSearchCombination(); Assert.False(res.IsValid); Assert.AreEqual(StringResource.START_VALUE_SHOULD_BE_SPECIFIED, res.Description); }
public void TestSearchValidStatus() { SearchModel <Status> model = new SearchModel <Status>() { Status = Status.hold }; SearchValidationResult res = model.IsValidSearchCombination(); Assert.True(res.IsValid); string[] searchArray = model.PropertiesToSearch(); Assert.AreEqual("with", searchArray[0]); Assert.AreEqual(Status.hold.ToString(), searchArray[1]); }
public void TestSearchValidStartTime() { DateTime date = DateTime.Now; SearchModel <Status> model = new SearchModel <Status>() { Start = date }; SearchValidationResult res = model.IsValidSearchCombination(); Assert.True(res.IsValid); string[] searchArray = model.PropertiesToSearch(); Assert.AreEqual("browse", searchArray[0]); Assert.AreEqual(date.ToUniversalTime().ToString(_dateFormat), searchArray[1]); }
public void TestSearchValidNoPaging() { DateTime date = DateTime.Now; SearchModel <Status> model = new SearchModel <Status>() { Status = Status.hold, End = date.AddMinutes(5), Start = date }; SearchValidationResult res = model.IsValidSearchCombination(); Assert.True(res.IsValid); string[] searchArray = model.PropertiesToSearch(); Assert.AreEqual("with", searchArray[0]); Assert.AreEqual(Status.hold.ToString(), searchArray[1]); Assert.AreEqual(date.ToUniversalTime().ToString(_dateFormat), searchArray[2]); Assert.AreEqual(date.ToUniversalTime().AddMinutes(5).ToString(_dateFormat), searchArray[3]); }
public void TestSearchValidAll() { DateTime date = DateTime.Now; SearchModel<Status> model = new SearchModel<Status>() { Status = Status.hold, End = date.AddMinutes(5), Start = date, Paging = 10 }; SearchValidationResult res = model.IsValidSearchCombination(); Assert.True(res.IsValid); string[] searchArray = model.PropertiesToSearch(); Assert.AreEqual("with", searchArray[0]); Assert.AreEqual(Status.hold.ToString(), searchArray[1]); Assert.AreEqual(date.ToUniversalTime().ToString(_dateFormat), searchArray[2]); Assert.AreEqual(date.ToUniversalTime().AddMinutes(5).ToString(_dateFormat), searchArray[3]); Assert.AreEqual("10", searchArray[4]); }
public void TestSearchValidStatus() { SearchModel<Status> model = new SearchModel<Status>() { Status = Status.hold }; SearchValidationResult res = model.IsValidSearchCombination(); Assert.True(res.IsValid); string[] searchArray = model.PropertiesToSearch(); Assert.AreEqual("with", searchArray[0]); Assert.AreEqual(Status.hold.ToString(), searchArray[1]); }
public void TestSearchValidStartTime() { DateTime date = DateTime.Now; SearchModel<Status> model = new SearchModel<Status>() { Start = date }; SearchValidationResult res = model.IsValidSearchCombination(); Assert.True(res.IsValid); string[] searchArray = model.PropertiesToSearch(); Assert.AreEqual("browse", searchArray[0]); Assert.AreEqual(date.ToUniversalTime().ToString(_dateFormat), searchArray[1]); }