public void CheckInRegistration_Returns_Success_For_Valid_RegId()
        {
            string serviceSuccessResponse = "Success!";

            this.PrepareEvent();
            this.CreateRegistration();

            string response = this.service.CheckInRegistration(this.registrationId);
            Assert.That(response.Equals(serviceSuccessResponse));

            // Check the reg's status == Attended
            RegOnlineAPIFixture apiFixture = new RegOnlineAPIFixture();
            ResultsOfListOfRegistration result = apiFixture.FetchRegistration(this.registrationId);
            Assert.IsTrue(result.Success);
            Assert.AreEqual(this.registrationId, result.Data[0].ID);
            Assert.AreEqual(RegOnline.RegressionTest.Managers.Report.ReportManager.AttendeeStatus.Attended.ToString(), result.Data[0].StatusDescription);
        }
        public void TennisAustraliaWebservice()
        {
            int newEventId = -1;
            using (ES.EventServiceSoapClient eventService = new ES.EventServiceSoapClient())
            {
                //eventService.Url = "https://beta.regonline.com/webservices/Events/EventService.asmx";
                //eventService. .AuthenticationHeaderValue = GetEventServiceAuthHeader();
                int badEventId = 0;

                int sourceEventId = 625868;
                int desitinationCustomerId = 377427;
                DateTime now = DateTime.Now;
                string clientEventId = "TPTestClientEventID";
                string eventTitle = "The Visual Test Event";
                string city = "Amsterdam";
                string state = "NH";
                string country = "Netherlands";
                string postalCode = "1111AB";
                string redirectConfirmationURL = "http://www.tournamentsoftware.com/link/onlinepaymentreturn.aspx?id={rolid}";
                DateTime? startDate = now;
                DateTime? endDate = now.AddDays(5);
                string creditCardDescriptor = "Test Descriptor";

                ES.EventBasics eventBasics = new ES.EventBasics();
                eventBasics.ClientEventID = clientEventId;
                eventBasics.EventTitle = eventTitle;
                eventBasics.City = city;
                eventBasics.State = state;
                eventBasics.PostalCode = postalCode;
                eventBasics.Country = country;
                eventBasics.StartDate = startDate;
                eventBasics.EndDate = endDate;
                eventBasics.CreditCardDescriptor = creditCardDescriptor;
                eventBasics.RedirectConfirmationURL = redirectConfirmationURL;

                ES.RegOnlineResponseOfInt32 eventResponse = eventService.CreateEventFromTemplate(GetEventServiceAuthHeader(), sourceEventId, desitinationCustomerId, eventBasics);
                newEventId = eventResponse.Value;

                Assert.Greater(eventResponse.Value, badEventId);

                RegOnlineAPIFixture apiFixture = new RegOnlineAPIFixture();
                ResultsOfListOfEvent result = apiFixture.FetchEvent(User, Password, newEventId);
                Assert.IsTrue(result.Success);
                Assert.AreEqual(eventTitle, result.Data[0].Title);
                Assert.AreEqual(RegOnline.RegressionTest.Managers.Manager.Dashboard.DashboardManager.EventStatus.Active.ToString(), result.Data[0].Status);

                using (RegistrationService.RegistrationServiceSoapClient regService = new RegistrationService.RegistrationServiceSoapClient())
                {
                    //regService.Url = "https://beta.regonline.com/webservices/Registrations/RegistrationService.asmx";
                    //regService.AuthenticationHeaderValue = GetRegistrationServiceAuthHeader();

                    RS.RegOnlineResponseOfInitializeRegistrationSessionResponseType regResponse =
                        regService.InitializeRegistrationSession(GetRegistrationServiceAuthHeader(), newEventId, 10, setupTemplatePersonalInfo());

                    Assert.That(regResponse.Status.Success);
                    Assert.That(regResponse.Value.SessionId.Length > 0);
                    Assert.That(regResponse.Value.RegistrationId > 0);
                    Assert.That(regResponse.Value.URL.Length > 0);

                    var db = new DataAccess.ClientDataContext(ConfigReader.DefaultProvider.EnvironmentConfiguration.ClientDbConnection);
                    var regs = (from r in db.Registrations where r.Register_Id == regResponse.Value.RegistrationId select r).ToList();
                    Assert.That(regs[0].Test == false);
                }

                //now update the event
                eventBasics.City = "Sydney";
                eventBasics.ID = newEventId;
                ES.RegOnlineResponseOfBoolean updateResponse = eventService.UpdateEvent(GetEventServiceAuthHeader(), eventBasics);
                Assert.That(updateResponse.Value);
                Assert.That(updateResponse.Status.Success);
            }
        }