public void TimeDestinationSet_Basic()
 {
     TimeDestinationSet<string> ds = new TimeDestinationSet<string>();
      ds.AddArea("a", 331, new DateTime(2014, 8, 1), DateTime.MaxValue);
      ds.AddArea("a", 335, new DateTime(2014, 8, 8), DateTime.MaxValue);
      Destination<string> d = ds.GetDestinationAtDate("a", new DateTime(2014, 8, 2));
      Assert.AreEqual("331", d.ToString());
      d = ds.GetDestinationAtDate("a", new DateTime(2014, 8, 10));
      Assert.AreEqual("331,335", d.ToString());
 }
 public void TimeDestinationSet_Boundary()
 {
     TimeDestinationSet<string> ds = new TimeDestinationSet<string>();
      ds.AddArea("a", 331, new DateTime(2014, 8, 1), new DateTime(2014, 8, 5));
      ds.AddArea("a", 335, new DateTime(2014, 8, 8), DateTime.MaxValue);
      Destination<string> d = default(Destination<string>);
      d = ds.GetDestinationAtDate("a", new DateTime(2014, 8, 5));
      Assert.AreEqual<string>(string.Empty, d.ToString());
      d = ds.GetDestinationAtDate("a", new DateTime(2014, 8, 8));
      Assert.AreEqual<string>("335", d.ToString());
      d = ds.GetDestinationAtDate("a", new DateTime(2014, 8, 7));
      Assert.AreEqual<string>(string.Empty, d.ToString());
      d = ds.GetDestinationAtDate("a", new DateTime(2014, 8, 4));
      Assert.AreEqual<string>("331", d.ToString());
 }
 public void TimeDestinationSet_NoArea()
 {
     TimeDestinationSet<string> ds = new TimeDestinationSet<string>();
      ds.AddArea("a", 331, new DateTime(2014, 8, 1), new DateTime(2014, 8, 5));
      ds.AddArea("a", 335, new DateTime(2014, 8, 8), DateTime.MaxValue);
      Destination<string> d = ds.GetDestinationAtDate("a", new DateTime(2014, 8, 6));
      Assert.AreEqual(string.Empty, d.ToString(), "No areas expected for destination 'a' at date 06-08-2014");
 }