Exemplo n.º 1
0
 private static Entry GetPopulatedEntry(Link link = null, Location location = null)
 {
     return new Entry
     {
         Fields = new
         {
             link,
             location,
             my_custom_nullable_datetime = default(DateTime?),
             my_custom_nullable_bool = default(bool?),
             my_custom_string = "hello!",
             my_custom_int = 15,
             my_custom_bool = true,
             my_custom_datetime = TestDate,
             my_custom_string_array = new []
             {
                 "one", "two", "three"
             },
             my_custom_object = new
             {
                 one = 1,
                 two = "two"
             }
         }
     };
 }
Exemplo n.º 2
0
 public void TestCanGetLocation()
 {
     var expectedLocation = new Location
     {
         Latitude = 45,
         Longitude = 60
     };
     var entry = GetPopulatedEntry(location: expectedLocation);
     var location = entry.GetLocation("location");
     Assert.IsNotNull(location);
     Assert.IsInstanceOf<Location>(location);
     Assert.AreEqual(expectedLocation.Latitude, location.Latitude);
     Assert.AreEqual(expectedLocation.Longitude, location.Longitude);
 }