public void ShouldSerializeResponseToJArray()
        {
            var jsonString =
                @"[{
                ""attributes"": [""2011-01""],
                ""metadata"": {""digest"": ""4dac11f9c09f3ebc8842790cd5dec24a""}
              }]";
            var expected = JArray.Parse(jsonString);
            var queryAggregateDigestsResponse = new QueryAggregateDigestsResponse(
                new List<AggregateDigest>() {
                    new AggregateDigest(new List<string> {"2011-01"}, "4dac11f9c09f3ebc8842790cd5dec24a")});

            Assert.AreEqual(expected.ToString(), queryAggregateDigestsResponse.ToJArray().ToString());
        }
Example #2
0
        public void ShouldSerializeResponseToJArray()
        {
            var jsonString =
                @"[{
                ""attributes"": [""2011-01""],
                ""metadata"": {""digest"": ""4dac11f9c09f3ebc8842790cd5dec24a""}
              }]";
            var expected = JArray.Parse(jsonString);
            var queryAggregateDigestsResponse = new QueryAggregateDigestsResponse(
                new List <AggregateDigest>()
            {
                new AggregateDigest(new List <string> {
                    "2011-01"
                }, "4dac11f9c09f3ebc8842790cd5dec24a")
            });

            Assert.AreEqual(expected.ToString(), queryAggregateDigestsResponse.ToJArray().ToString());
        }