public void SerializeTicketCancelTest()
        {
            var ticket             = TicketBuilderHelper.GetTicketCancel();
            var serialized         = JsonConvert.SerializeObject(ticket);
            var deserializedTicket = JsonUtils.Deserialize <ITicketCancel>(serialized);
            var serializedAgain    = JsonUtils.Serialize(deserializedTicket);

            Assert.AreEqual(serialized, serializedAgain);
        }
Example #2
0
        public void TicketCancelToJsonTest()
        {
            var ticket     = TicketBuilderHelper.GetTicketCancel();
            var dto        = new TicketCancelMapper().Map(ticket);
            var ticketJson = ticket.ToJson();
            var dtoJson    = dto.ToJson();

            CheckMandatoryFields(ticketJson);
            CheckMandatoryFields(dtoJson);

            Assert.AreEqual(ticketJson, dtoJson);
        }
Example #3
0
        public void BuildTicketCancelDtoFromTicketCancelTest()
        {
            var ticket = TicketBuilderHelper.GetTicketCancel();
            var dto    = new TicketCancelMapper().Map(ticket);
            var json   = dto.ToJson();

            var newDto = new TicketCancelDTO {
                Cancel = Cancel.FromJson(json)
            };

            TicketCompareHelper.Compare(ticket, dto);
            TicketCompareHelper.Compare(ticket, newDto);
        }