public void TestAccessCode()
        {
            evt = new Event("AccessCodeFixture");
            paymentMethod = new PaymentMethod(FormData.PaymentMethod.Check);
            evt.CheckoutPage.PaymentMethods.Add(paymentMethod);
            regType = new RegType("RegType");
            regType.Price = 50;
            CustomFieldCode ac1 = new CustomFieldCode("ac1");
            ac1.CodeType = FormData.CustomFieldCodeType.AccessCode;
            ac1.Limit = 2;
            regType.AllCustomCodes.Add(ac1);
            CustomFieldCode ac2 = new CustomFieldCode("ac2");
            ac2.CodeType = FormData.CustomFieldCodeType.AccessCode;
            regType.AllCustomCodes.Add(ac2);
            evt.StartPage.RegTypes.Add(regType);

            agenda = new AgendaItem_CheckBox("Agenda");
            agenda.Price = 80;
            CustomFieldCode ac3 = new CustomFieldCode("ac3");
            ac3.CodeType = FormData.CustomFieldCodeType.AccessCode;
            ac3.Limit = 2;
            CustomFieldCode ac4 = new CustomFieldCode("ac4");
            ac4.CodeType = FormData.CustomFieldCodeType.AccessCode;
            agenda.DiscountCodes.Add(ac3);
            agenda.DiscountCodes.Add(ac4);
            agenda.BulkCodes = CustomFieldCode.GenerateBulkCodes(agenda.DiscountCodes);
            evt.AgendaPage = new AgendaPage();
            evt.AgendaPage.AgendaItems.Add(agenda);

            merch = new MerchandiseItem("Merch");
            merch.Type = FormData.MerchandiseType.Fixed;
            merch.Price = 110;
            CustomFieldCode ac5 = new CustomFieldCode("ac5");
            ac5.CodeType = FormData.CustomFieldCodeType.AccessCode;
            merch.DiscountCodes.Add(ac5);
            evt.MerchandisePage = new MerchandisePage();
            evt.MerchandisePage.Merchandises.Add(merch);

            KeywordProvider.SignIn.SignInAndRecreateEventAndGetEventId(EventFolders.Folders.RegistrationInventory, evt, false, true);

            Registrant reg1 = this.GenerateReg(ac1, ac3, ac5);
            KeywordProvider.RegistrationCreation.CreateRegistration(reg1);
            Assert.True(KeywordProvider.RegisterDefault.GetTotal(FormData.RegisterPage.Confirmation) == 240);
            Registrant reg2 = this.GenerateReg(ac1, ac3, ac5);
            KeywordProvider.RegistrationCreation.CreateRegistration(reg2);
            Assert.True(KeywordProvider.RegisterDefault.GetTotal(FormData.RegisterPage.Confirmation) == 240);
            Registrant reg3 = this.GenerateReg(ac1, ac4, ac5);
            KeywordProvider.RegistrationCreation.Checkin(reg3);
            Assert.True(KeywordProvider.RegisterDefault.HasErrorMessage(string.Format(Messages.RegisterError.RegTypeCodeLimitHasReached, ac1.CodeString)));
            Registrant reg4 = this.GenerateReg(ac2, ac3, ac5);
            KeywordProvider.RegistrationCreation.Checkin(reg4);
            KeywordProvider.RegistrationCreation.PersonalInfo(reg4);
            KeywordProvider.RegistrationCreation.Agenda(reg4);
            Assert.True(KeywordProvider.RegisterDefault.HasErrorMessage(Messages.RegisterError.AgendaCodeLimitReached));
            Registrant reg5 = this.GenerateReg(ac2, ac4, ac5);
            KeywordProvider.RegistrationCreation.CreateRegistration(reg5);
            Assert.True(KeywordProvider.RegisterDefault.GetTotal(FormData.RegisterPage.Confirmation) == 240);
        }
        public void VerifyGloableEventDisplay()
        {
            Event Event = new Event("RI-VerifyDisplay");
            Event.StartPage.Location = "Sichuan";
            Event.StartPage.Phone = "8888888888";
            Event.StartPage.Country = "United States";
            Event.StartPage.Address1 = "Fuxing Road No.1";
            Event.StartPage.Address2 = "Huamin Empire Plaza";
            Event.StartPage.City = "Chengdu";
            Event.StartPage.State = "Alaska";
            Event.StartPage.Zip = "12345";
            Event.StartPage.ContactInfo = "Contact us!";
            Event.StartPage.EventHome = "www.google.com";
            Event.StartPage.PageHeader = "This is checkin Page Header.";
            Event.StartPage.PageFooter = "This is checkin Page Footer.";
            Event.PersonalInfoPage.PageHeader = "This is personal info Page Header.";
            Event.PersonalInfoPage.PageFooter = "This is personal info Page Footer.";

            AgendaItem_CheckBox agendaItem = new AgendaItem_CheckBox(DateTime.Now.Ticks.ToString());
            DataCollection.AgendaPage agendaPage = new DataCollection.AgendaPage();
            agendaPage.AgendaItems.Add(agendaItem);
            agendaPage.PageHeader = "This is agenda Page Header.";
            agendaPage.PageFooter = "This is agenda Page Footer.";
            Event.AgendaPage = agendaPage;

            LodgingStandardFields field = new LodgingStandardFields();
            field.Field = FormData.LodgingStandardFields.RoomType;
            field.Visible = true;
            Lodging lodging = new Lodging();
            lodging.StandardFields.Add(field);
            LodgingTravelPage lodgingTravelPage = new LodgingTravelPage();
            lodgingTravelPage.Lodging = lodging;
            lodgingTravelPage.PageHeader = "This is lodging travel Page Header.";
            lodgingTravelPage.PageFooter = "This is lodging travel Page Footer.";
            Event.LodgingTravelPage = lodgingTravelPage;

            MerchandiseItem merchandise = new MerchandiseItem(DateTime.Now.AddSeconds(1).Ticks.ToString());
            merchandise.Type = FormData.MerchandiseType.Header;
            MerchandisePage merchandisePage = new MerchandisePage();
            merchandisePage.Merchandises.Add(merchandise);
            merchandisePage.PageHeader = "This is merchandise Page Header.";
            merchandisePage.PageFooter = "This is merchandise Page Footer.";
            Event.MerchandisePage = merchandisePage;

            Event.CheckoutPage.PageHeader = "This is checkout Page Header.";
            Event.CheckoutPage.PageFooter = "This is checkout Page Footer.";

            KeywordProvider.SignIn.SignInAndRecreateEventAndGetEventId(EventFolders.Folders.RegistrationInventory, Event, false, false);
            Registrant reg = new Registrant(Event);

            PageObject.PageObjectProvider.Register.RegistationSite.Checkin.OpenUrl(reg);
            VerifyFooterResults footerResults = KeywordProvider.Display.VerifyCompanyFooter();
            VerifyEventDetailsResult eventDetailsResults = KeywordProvider.Display.VerifyEventDetails();
            VerifyPageResults pageResults = KeywordProvider.Display.VerifyPage();

            Assert.True(footerResults.Trustwave);
            Assert.True(footerResults.Facebook);
            Assert.True(footerResults.Twitter);
            Assert.True(footerResults.Linkedin);
            Assert.True(footerResults.Copyright == "Copyright © 2012 The Active Network, Inc.");
            Assert.True(footerResults.TermsOfUse);
            Assert.True(footerResults.PrivacyPolicy);
            Assert.True(footerResults.CookiePolicy);
            Assert.True(footerResults.About);
            Assert.True(footerResults.ActiveCom);

            Assert.True(eventDetailsResults.EventTitle == Event.Title);
            Assert.True((eventDetailsResults.Location == Event.StartPage.Location) || (eventDetailsResults.Location == null));
            Assert.True((eventDetailsResults.Phone == Event.StartPage.Phone) || (eventDetailsResults.Phone == null));
            Assert.True((eventDetailsResults.Address1 == Event.StartPage.Address1) || (eventDetailsResults.Address1 == null));
            Assert.True((eventDetailsResults.Address2 == Event.StartPage.Address2) || (eventDetailsResults.Address2 == null));
            Assert.True((eventDetailsResults.City == Event.StartPage.City) || (eventDetailsResults.City == null));
            Assert.True((eventDetailsResults.State == Event.StartPage.State) || (eventDetailsResults.State == null));
            Assert.True((eventDetailsResults.Zip == Event.StartPage.Zip) || (eventDetailsResults.Zip == null));
            Assert.True((eventDetailsResults.Country == Event.StartPage.Country) || (eventDetailsResults.Country == null));
            Assert.True(eventDetailsResults.EventContactInfo.Contains(Event.StartPage.ContactInfo) && eventDetailsResults.Contact.Contains(Event.StartPage.ContactInfo));

            Assert.True(pageResults.PageHeader.Contains(Event.StartPage.PageHeader));
            Assert.True(pageResults.PageFooter.Contains(Event.StartPage.PageFooter));

            KeywordProvider.RegistrationCreation.Checkin(reg);
            pageResults = KeywordProvider.Display.VerifyPage();

            Assert.True(pageResults.PageHeader.Contains(Event.PersonalInfoPage.PageHeader));
            Assert.True(pageResults.PageFooter.Contains(Event.PersonalInfoPage.PageFooter));

            KeywordProvider.RegistrationCreation.PersonalInfo(reg);
            pageResults = KeywordProvider.Display.VerifyPage();

            Assert.True(pageResults.PageHeader.Contains(Event.AgendaPage.PageHeader));
            Assert.True(pageResults.PageFooter.Contains(Event.AgendaPage.PageFooter));

            PageObject.PageObjectProvider.Register.RegistationSite.Continue_Click();
            pageResults = KeywordProvider.Display.VerifyPage();

            Assert.True(pageResults.PageHeader.Contains(Event.LodgingTravelPage.PageHeader));
            Assert.True(pageResults.PageFooter.Contains(Event.LodgingTravelPage.PageFooter));

            PageObject.PageObjectProvider.Register.RegistationSite.Continue_Click();
            pageResults = KeywordProvider.Display.VerifyPage();

            Assert.True(pageResults.PageHeader.Contains(Event.MerchandisePage.PageHeader));
            Assert.True(pageResults.PageFooter.Contains(Event.MerchandisePage.PageFooter));

            PageObject.PageObjectProvider.Register.RegistationSite.Continue_Click();
            pageResults = KeywordProvider.Display.VerifyPage();

            Assert.True(pageResults.PageHeader.Contains(Event.CheckoutPage.PageHeader));
            Assert.True(pageResults.PageFooter.Contains(Event.CheckoutPage.PageFooter));
        }
        private void GenerateEventForTaxRate(bool applyTaxOne, bool applyTaxTwo, FormData.Countries? country)
        {
            this.evt = new Event("TaxFixture");
            this.regType = new RegType("regType");
            this.paymentMethod = new PaymentMethod(FormData.PaymentMethod.Check);
            TaxRate tax1 = new TaxRate("tax1");
            if (country.HasValue)
            {
                tax1.Country = country.Value;
            }
            tax1.Rate = 50;
            TaxRate tax2 = new TaxRate("tax2");
            tax2.Rate = 10;
            regType.Price = 50;
            regType.ApplyTaxOne = applyTaxOne;
            regType.ApplyTaxTwo = applyTaxTwo;
            evt.TaxRateOne = tax1;
            evt.TaxRateTwo = tax2;
            evt.StartPage.RegTypes.Add(regType);
            evt.CheckoutPage.PaymentMethods.Add(paymentMethod);
            this.agenda = new AgendaItem_CheckBox("agenda");
            agenda.Price = 60;
            agenda.ApplyTaxOne = applyTaxOne;
            agenda.ApplyTaxTwo = applyTaxTwo;
            evt.AgendaPage = new AgendaPage();
            evt.AgendaPage.AgendaItems.Add(agenda);
            this.merch = new MerchandiseItem("merch");
            merch.Type = FormData.MerchandiseType.Fixed;
            merch.Price = 70;
            merch.ApplyTaxOne = applyTaxOne;
            merch.ApplyTaxTwo = applyTaxTwo;
            evt.MerchandisePage = new MerchandisePage();
            evt.MerchandisePage.Merchandises.Add(merch);

            KeywordProvider.SignIn.SignInAndRecreateEventAndGetEventId(EventFolders.Folders.RegistrationInventory, evt);
        }