Esempio n. 1
0
        public void BuildTicketResponseDtoFromTicketResponseTest()
        {
            var dto    = TicketBuilderHelper.GetTicketResponse();
            var ticket = new TicketResponseMapper(null).Map(dto, SR.S1000, null, dto.ToJson());

            TicketCompareHelper.Compare(ticket, dto);
        }
Esempio n. 2
0
        public void TicketResponseToJsonTest()
        {
            var dto        = TicketBuilderHelper.GetTicketResponse();
            var ticket     = new TicketResponseMapper(null).Map(dto, "c1", null, dto.ToJson());
            var ticketJson = ticket.ToJson();
            var dtoJson    = dto.ToJson();

            CheckResponseFields(ticketJson);
            CheckResponseFields(dtoJson);

            Assert.AreEqual(ticketJson, dtoJson);
        }
Esempio n. 3
0
        public void BuildTicketAltStakeTest()
        {
            var ticket            = TicketBuilderHelper.GetTicket();
            var ticketResponseDto = TicketBuilderHelper.GetTicketResponse(ticket, Status.Rejected, false, true);
            var ticketResponse    = new TicketResponseMapper(null).Map(ticketResponseDto, S1000, null, ticketResponseDto.ToJson());

            Thread.Sleep(500);
            var reofferTicket = new BuilderFactoryHelper().BuilderFactory.CreateAltStakeBuilder().Set(ticket, ticketResponse, "altStakeTicket-" + I1000P).BuildTicket();

            Assert.IsNotNull(reofferTicket);
            TicketCompareHelper.Compare(ticket, reofferTicket, false, true);
        }