public void SearchRequestIdGeneratorTest_Oneway_AssertIsTrue() { var searchCriteria = new SearchCriteria[1] { new SearchCriteria("ATH","BCN",DateTime.Now.AddDays(15)) }; var flightSearchRequest = new FlightSearchRequest(1, 2, 0, 1, 0, 0, CabinClass.Any, "", false, false, searchCriteria); Assert.IsTrue(flightSearchRequest.IsValid()); Assert.AreEqual(flightSearchRequest.SearchRequestIdGenerator(), string.Format("ATH_BCN_{0}-120100-Any--False", DateTime.Now.AddDays(15).ToString("d"))); }
public void SearchRequestIdGeneratorTest_Roundtrip_AssertIsTrue() { var searchCriteria = new SearchCriteria[2] { new SearchCriteria("ATH","BCN",DateTime.Now.AddDays(15)), new SearchCriteria("BCN","ATH",DateTime.Now.AddDays(20)) }; var flightSearchRequest = new FlightSearchRequest(2, 1, 0, 0, 0, 0, CabinClass.Any, "", false, false, searchCriteria); Assert.IsTrue(flightSearchRequest.IsValid()); Assert.AreEqual(flightSearchRequest.SearchRequestIdGenerator(), string.Format("ATH_BCN_{0}-BCN_ATH_{1}-210000-Any--False", DateTime.Now.AddDays(15).ToString("d"), DateTime.Now.AddDays(20).ToString("d"))); }