public void ItCanMapFromDynamicTableEntity() { // g const string valueString = "something"; var aTimestamp = DateTimeOffset.UtcNow; var ce = new DynamicTableEntity {ETag = valueString, Timestamp = aTimestamp}; ce.Properties.Add("id", new EntityProperty(valueString)); ce.Properties.Add("name", new EntityProperty(valueString)); var expected = JsonObjectFactory.CreateJsonObjectWithTimestamp(aTimestamp); // w var json = ce.ToJsonObject(); // t json.ShouldBeEquivalentTo(expected); }
public void ItShouldInflateArrays() { // g var expected = new object[] {"1", "2", "3"}; var expectedString = JsonConvert.SerializeObject(expected); var ce = new DynamicTableEntity(); ce.Properties.Add("dragon_ids", new EntityProperty(expectedString)); // w var json = ce.ToJsonObject(); // t json["dragon_ids"].ShouldBeEquivalentTo(expected); }