Esempio n. 1
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);
        }