public void ServiceAttendEventTest()
        {
            CongregatioServiceClient client = new CongregatioServiceClient();
            var user = ObjectHelpers.CreateUser("*****@*****.**");
            var @event = ObjectHelpers.CreateEvent(user, "ServiceAttendEventTest");
            var attendee = ObjectHelpers.CreateUser("*****@*****.**");
            try
            {
                client.AddUser(user);
                client.AddUser(attendee);
                client.AddEvent(@event);
                //user = unit.UserRepository.FindByEmail(user.Email);
                attendee = client.FindUserByEmail(attendee.Email);
                @event = client.GetEventByTitle(@event.EventTitle);
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
            }

            try
            {
                client.AttendEvent(attendee.UserId, @event);
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
            }

            @event = client.GetEventByIdLong(@event.Id);
            attendee =client.FindUserById(attendee.UserId);
            Assert.IsTrue(attendee.AttendedEvents.Count > 0);
            Assert.IsTrue(@event.Attendees.Count > 0);
            CleanUp(client, @event, attendee);
        }
Ejemplo n.º 2
0
        public void ServiceReportEvent()
        {
            CongregatioServiceClient client = new CongregatioServiceClient();
            var user = ObjectHelpers.CreateUser("*****@*****.**");
            var @event = ObjectHelpers.CreateEvent(user);
            client.AddUser(user);
            client.AddEvent(@event);
            user = client.FindUserByEmail(user.Email);
            @event = client.GetEventByTitle(@event.EventTitle);
            client.ReportEvent(user.UserId,@event.Id, "ServiceReportTest");
            var reports = client.FindReportsByEvent(@event.Id);
            Assert.IsTrue(reports.Any());
            Assert.IsTrue(reports.FirstOrDefault().Reason.Equals("ServiceReportTest"));

            reports = client.FindReportsByUser(user.UserId);
            Assert.IsTrue(reports.Any());
            Assert.IsTrue(reports.FirstOrDefault().Reason.Equals("ServiceReportTest"));
            var report = reports.FirstOrDefault();
            CleanUp(client,report);
        }
 public void SuggestedEventsTest()
 {
     CongregatioServiceClient client = new CongregatioServiceClient();
     var stalked = ObjectHelpers.CreateUser("*****@*****.**");
     var stalker = ObjectHelpers.CreateUser("*****@*****.**");
     var stalkedHostedEvent = ObjectHelpers.CreateEvent(stalked);
     client.AddUser(stalked);
     client.AddUser(stalker);
     client.AddEvent(stalkedHostedEvent);
     stalkedHostedEvent = client.GetEventByTitle(stalkedHostedEvent.EventTitle);
     client.StalkUser(stalker.UserId, stalked.UserId);
     stalked = client.FindUserById(stalked.UserId);
     stalker = client.FindUserById(stalker.UserId);
     var events = client.SuggestedEvents(stalker.UserId);
     Assert.IsTrue(events.Count > 0);
     Assert.IsTrue(events[0].EventTitle.Equals(stalkedHostedEvent.EventTitle));
     CleanUp(client, stalker, stalkedHostedEvent);
 }