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); }
public static void Compare(ITicketCancel ticket, TicketCancelDTO dto) { Assert.IsTrue(ticket != null); Assert.IsTrue(dto != null); Assert.AreEqual(ticket.TicketId, dto.Cancel.TicketId); Assert.AreEqual(MtsTicketHelper.Convert(ticket.Timestamp), dto.Cancel.TimestampUtc); Assert.AreEqual(ticket.Version, dto.Cancel.Version); Assert.AreEqual(ticket.BookmakerId, dto.Cancel.Sender.BookmakerId); Assert.AreEqual((int)ticket.Code, dto.Cancel.Code); Assert.IsFalse(string.IsNullOrEmpty(ticket.CorrelationId)); }