Пример #1
0
        public void BuildTicketValidPercentTest()
        {
            var tb = TicketCancelBuilder.Create();

            tb.SetCancelPercent(1)
            .SetCancelPercent(1000000)
            .SetCancelPercent(10101);
        }
Пример #2
0
        public void BuildTicketWithNoTicketIdTest()
        {
            var tb     = TicketCancelBuilder.Create();
            var ticket = tb.SetBookmakerId(SR.I1000)
                         .SetCode(TicketCancellationReason.BookmakerBackofficeTriggered)
                         .BuildTicket();

            Assert.IsNull(ticket);
        }
Пример #3
0
        public void BuildTicketWithNoCodeTest()
        {
            var tb     = TicketCancelBuilder.Create();
            var ticket = tb.SetTicketId("ticket-" + SR.I1000P)
                         .SetBookmakerId(SR.I1000)
                         .BuildTicket();

            Assert.IsNull(ticket);
        }
Пример #4
0
        public void BuildTicketBetCancelAndPercentTest()
        {
            var tb = TicketCancelBuilder.Create();

            tb.SetTicketId("ticket-" + SR.I1000P)
            .SetBookmakerId(SR.I1000)
            .SetCode(TicketCancellationReason.BookmakerBackofficeTriggered)
            .SetCancelPercent(2132)
            .AddBetCancel("bet-id-02", null)
            .BuildTicket();
        }
Пример #5
0
        public void BuildTicketAckFromTicketTest()
        {
            var ticket = TicketCancelBuilder.Create().SetTicketId("ticket-" + SR.I1000P).SetBookmakerId(SR.I1000).SetCode(TicketCancellationReason.BookmakerBackofficeTriggered).BuildTicket();

            var ticketAck = new TicketCancelAck(ticket, TicketCancelAckStatus.Cancelled, 100, "message");

            Assert.IsNotNull(ticketAck);
            Assert.IsTrue(ticketAck.Timestamp > DateTime.Today.ToUniversalTime());
            Assert.AreEqual(TicketHelper.MtsTicketVersion, ticketAck.Version);
            Assert.IsTrue(!string.IsNullOrEmpty(ticketAck.TicketId));
            Assert.AreEqual(ticketAck.TicketId, ticket.TicketId);
            Assert.AreEqual(ticket.BookmakerId, ticketAck.BookmakerId);
        }
Пример #6
0
        public void BuildBaseTicketTest()
        {
            var tb     = TicketCancelBuilder.Create();
            var ticket = tb.SetTicketId("ticket-" + SR.I1000P)
                         .SetBookmakerId(SR.I1000)
                         .SetCode(TicketCancellationReason.BookmakerBackofficeTriggered)
                         .BuildTicket();

            Assert.IsNotNull(ticket);
            Assert.IsTrue(ticket.Timestamp > DateTime.Today.ToUniversalTime());
            Assert.AreEqual(TicketHelper.MtsTicketVersion, ticket.Version);
            Assert.IsTrue(!string.IsNullOrEmpty(ticket.TicketId));
        }
Пример #7
0
        public void BuildTicketPercentTest()
        {
            var tb     = TicketCancelBuilder.Create();
            var ticket = tb.SetTicketId("ticket-" + SR.I1000P)
                         .SetBookmakerId(SR.I1000)
                         .SetCode(TicketCancellationReason.BookmakerBackofficeTriggered)
                         .SetCancelPercent(2132)
                         .BuildTicket();
            var dto = new TicketCancelMapper().Map(ticket);

            Assert.IsNotNull(ticket);
            Assert.IsTrue(ticket.Timestamp > DateTime.Today.ToUniversalTime());
            Assert.IsNotNull(ticket.CancelPercent);
            Assert.AreEqual(2132, ticket.CancelPercent);
            Assert.AreEqual(ticket.CancelPercent, dto.Cancel.CancelPercent);
            Assert.IsNull(ticket.BetCancels);
            Assert.IsNull(dto.Cancel.BetCancel);
        }
Пример #8
0
        public void BuildTicketTooHighPercentTest()
        {
            var tb = TicketCancelBuilder.Create();

            tb.SetCancelPercent(1000001);
        }
Пример #9
0
        public void BuildTicketTooLowPercentTest()
        {
            var tb = TicketCancelBuilder.Create();

            tb.SetCancelPercent(0);
        }
Пример #10
0
        public void BuildTicketBetCancelMissingBetIdTest()
        {
            var tb = TicketCancelBuilder.Create();

            tb.AddBetCancel("", 1220);
        }