public void DeserializeRelativeNtaResponse()
        {
            var serializer = new RestClientSerializer();

            var id   = Guid.NewGuid();
            var json = "{\"id\":\"" + id + "\","
                       + "\"asxCode\":\"ABC\","
                       + "\"name\":\"ABC Pty Ltd\","
                       + "\"trust\":true,"
                       + "\"category\":\"internationalProperty\","
                       + "\"relativeNtas\":["
                       + "{\"fromDate\":\"2001-01-02\",\"toDate\":\"2001-02-03\",\"relativeNtas\":["
                       + "{\"childSecurity\":\"ABC1\",\"percentage\":0.40},"
                       + "{\"childSecurity\":\"ABC2\",\"percentage\":0.60}"
                       + "]}"
                       + "]}";

            var command = serializer.Deserialize <RelativeNtaResponse>(json);

            var expected = new RelativeNtaResponse()
            {
                Id      = id,
                AsxCode = "ABC",
                Name    = "ABC Pty Ltd",
            };
            var childNtas = new RelativeNtaResponse.ChildSecurityNta[]
            {
                new RelativeNtaResponse.ChildSecurityNta("ABC1", 0.40m),
                new RelativeNtaResponse.ChildSecurityNta("ABC2", 0.60m),
            };

            expected.AddRelativeNta(new Date(2001, 01, 02), new Date(2001, 02, 03), childNtas);

            command.Should().BeEquivalentTo(expected);
        }
        public void SerializeRelativeNtaResponse()
        {
            var serializer = new RestClientSerializer();

            var id      = Guid.NewGuid();
            var command = new RelativeNtaResponse()
            {
                Id      = id,
                AsxCode = "ABC",
                Name    = "ABC Pty Ltd",
            };
            var childNtas = new RelativeNtaResponse.ChildSecurityNta[]
            {
                new RelativeNtaResponse.ChildSecurityNta("ABC1", 0.40m),
                new RelativeNtaResponse.ChildSecurityNta("ABC2", 0.60m),
            };

            command.AddRelativeNta(new Date(2001, 01, 02), new Date(2001, 02, 03), childNtas);

            var json = JToken.Parse(serializer.Serialize(command));

            var expectedJson = JToken.Parse("{\"id\":\"" + id + "\","
                                            + "\"asxCode\":\"ABC\","
                                            + "\"name\":\"ABC Pty Ltd\","
                                            + "\"relativeNtas\":["
                                            + "{\"fromDate\":\"2001-01-02\",\"toDate\":\"2001-02-03\",\"relativeNtas\":["
                                            + "{\"childSecurity\":\"ABC1\",\"percentage\":0.40},"
                                            + "{\"childSecurity\":\"ABC2\",\"percentage\":0.60}"
                                            + "]}"
                                            + "]}");

            json.Should().BeEquivalentTo(expectedJson);
        }