Esempio n. 1
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);
        }
Esempio n. 2
0
        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));
        }