public void ServiceStalkUserTest() { CongregatioServiceClient client = new CongregatioServiceClient(); var stalker = ObjectHelpers.CreateUser("*****@*****.**"); var stalked = ObjectHelpers.CreateUser("*****@*****.**"); client.AddUser(stalker); client.AddUser(stalked); stalker = client.FindUserByEmail(stalker.Email); stalked = client.FindUserByEmail(stalked.Email); //stalker.StalkedPeople.Add(stalked); //client.UpdateUser(stalker); client.StalkUser(stalker.UserId, stalked.UserId); stalker = client.FindUserByEmail(stalker.Email); stalked = client.FindUserByEmail(stalked.Email); Assert.IsTrue(stalker.StalkedPeople.Count > 0); Assert.IsTrue(stalked.Stalkers.Count > 0); CleanUp(stalker, client); CleanUp(client.FindUserById(stalked.UserId), client); }
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); }