Esempio n. 1
0
        public void SeeIfOrdersAndTicketsWork()
        {
            var org  = orgs.StoreNew(OrganisersTest.MakeOrganiser());
            var evnt = events.StoreNew(EventsTest.MakeEvent(org));
            var tix  = new List <OrderRequestTicket>(new OrderRequestTicket[] {
                new OrderRequestTicket()
                {
                    Barcode      = "0xDEADBEEF",
                    EntryType    = "Op schoot bij ome willem",
                    TicketType   = "QR",
                    TicketeerRef = "Ticket-" + Guid.NewGuid().ToString(),
                }
            });
            var order = new OrderRequest()
            {
                Email        = "*****@*****.**",
                EventId      = evnt.TicketeerRef,
                FirstName    = "Flabbert",
                LastName     = "Ruigfluit",
                SendEmail    = "false",
                TicketeerRef = "Order-" + Guid.NewGuid().ToString(),
                Tickets      = tix
            };
            var resp = SUT.StoreNew(order);

            Assert.True(resp.OrderShareId.Length > 0);
            Assert.True(resp.TicketPublicIds.Count > 0);

            var ticket = SUT.GetTicketByPublicID(resp.TicketPublicIds[0]);
            // to whomever it may concern: i'm not sure how the /ticket/ response
            // works. please discuss this out with the actual API developer and
            // do a pull request or something when you've figured it out.
        }
Esempio n. 2
0
        public void CheckUpdate()
        {
            var         organiser    = oFactory.StoreNew(OrganisersTest.MakeOrganiser());
            GettinEvent eventToStore = MakeEvent(organiser);
            var         storedEvent  = SUT.StoreNew(eventToStore);

            storedEvent.Description = "Take me back to wonderland";
            var updatedEvent = SUT.Update(storedEvent);

            Assert.True(updatedEvent.Description == storedEvent.Description);
        }
Esempio n. 3
0
        public void CheckGet()
        {
            var         organiser    = oFactory.StoreNew(OrganisersTest.MakeOrganiser());
            GettinEvent eventToStore = MakeEvent(organiser);
            var         storedEvent  = SUT.StoreNew(eventToStore);

            var gottenEvent = SUT.GetByID(storedEvent.PublicID);

            Assert.Greater(gottenEvent.PublicID.Length, 0);
            Assert.True(gottenEvent.Name == eventToStore.Name);
            // same test for brevity here.
        }
Esempio n. 4
0
        public void CheckPost()
        {
            var         organiser    = oFactory.StoreNew(OrganisersTest.MakeOrganiser());
            GettinEvent eventToStore = MakeEvent(organiser);
            var         storedEvent  = SUT.StoreNew(eventToStore);

            Assert.Greater(storedEvent.PublicID.Length, 0);
            // Assert.True(storedEvent.Name == eventToStore.PublicID);
            // we could test all the properties here but if we're getting an ID,
            // we ASSUME the tests on the actual api cover the completeness
            // of the rest
        }