public void BuildTicketCancelDtoFromJsonTest() { var json = FileHelper.ReadFile(DirPath, @"ticket-cancel.json"); var dto = Cancel.FromJson(json); Assert.IsNotNull(dto); Assert.AreEqual(dto.Sender.BookmakerId, 9985); Assert.AreEqual(dto.Code, (int)TicketCancellationReason.BookmakerTechnicalIssue); Assert.AreEqual(dto.Version, "2.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); }