public void UpdateProjectUsers() { if (!Settings.ModifyTests) { return; } ApiList <Person> people = Person.GetPeopleOnProject(Api, Settings.TestProject).Result; if (people.All(Api).Any(p => p.id == Settings.TestUser2)) { Person.UpdateProjectUsers(Api, Settings.TestProject, new UpdateProjectUsersList() { revoke = new long[] { Settings.TestUser2 } }).Wait(); } UpdateProjectUsersResult result = RunTest(Person.UpdateProjectUsers(Api, Settings.TestProject, new UpdateProjectUsersList() { grant = new long[] { Settings.TestUser2 } })); Assert.IsTrue(result.granted.Length == 0 || result.granted[0].id == Settings.TestUser2); people = Person.GetPeopleOnProject(Api, Settings.TestProject).Result; Assert.IsTrue(people.All(Api).Any(p => p.id == Settings.TestUser2)); result = RunTest(Person.UpdateProjectUsers(Api, Settings.TestProject, new UpdateProjectUsersList() { revoke = new long[] { Settings.TestUser2 } })); Assert.AreEqual(Settings.TestUser2, result.revoked[0].id); people = Person.GetPeopleOnProject(Api, Settings.TestProject).Result; Assert.IsFalse(people.All(Api).Any(p => p.id == Settings.TestUser2)); }
public void GetPingablePeople() { ApiList <Person> people = RunTest(Person.GetPingablePeople(Api)); Person psn = people.All(Api).FirstOrDefault(p => p.id == Settings.TestUser); psn = people.All(Api).FirstOrDefault(p => p.id == Settings.TestUser2); List <Person> all = people.All(Api).ToList(); Assert.IsTrue(all.Any(p => p.id == Settings.TestUser)); Assert.IsTrue(all.Any(p => p.id == Settings.TestUser2)); }
public void CreateAndDeleteLine() { if (!Settings.ModifyTests) { return; } Campfire c = Campfire.GetCampfire(Api, Settings.TestProject, Settings.TestCampfire).Result; CampfireLine l = c.CreateLine(Api, "Test Campfire Line").Result; ApiList <CampfireLine> lines = RunTest(c.GetLines(Api)); Assert.IsTrue(lines.All(Api).Any(ln => ln.id == l.id)); RunTest(l.Delete(Api)); lines = RunTest(c.GetLines(Api)); Assert.IsFalse(lines.All(Api).Any(ln => ln.id == l.id)); }
public void GetLines() { Campfire c = Campfire.GetCampfire(Api, Settings.TestProject, Settings.TestCampfire).Result; ApiList <CampfireLine> lines = RunTest(c.GetLines(Api)); Assert.IsTrue(lines.All(Api).Any(l => l.id == Settings.TestCampfireLine)); }
public void GetMessages() { MessageBoard b = MessageBoard.GetMessageBoard(Api, Settings.TestProject, Settings.TestMessageBoard).Result; ApiList <Message> messages = RunTest(b.GetMessages(Api)); Assert.IsTrue(messages.All(Api).Any(m => m.id == Settings.TestMessage)); }
public void GetMessageTypes() { ApiList <MessageType> messageTypes = RunTest(MessageType.GetMessageTypes(Api, Settings.TestProject)); Assert.IsTrue(messageTypes.All(Api).Any(m => m.id == Settings.AnnouncementMessageType)); ; }
public void CreateModifyDeleteMessageType() { if (!Settings.ModifyTests) { return; } string name = "Test message type"; string icon = "t"; string name2 = "Altered message type"; string icon2 = "a"; ApiList <MessageType> messages = RunTest(MessageType.GetMessageTypes(Api, Settings.TestProject)); List <MessageType> all = messages.All(Api).ToList(); MessageType d = all.FirstOrDefault(x => x.name == name); if (d != null) { d.Destroy(Api, Settings.TestProject).Wait(); } d = all.FirstOrDefault(x => x.name == name2); if (d != null) { d.Destroy(Api, Settings.TestProject).Wait(); } MessageType m = MessageType.Create(Api, Settings.TestProject, name, icon).Result; Assert.AreEqual(name, m.name); Assert.AreEqual(icon, m.icon); MessageType changed = m.Update(Api, Settings.TestProject, name2, icon2).Result; Assert.AreEqual(name2, changed.name); Assert.AreEqual(icon2, changed.icon); changed.Destroy(Api, Settings.TestProject).Wait(); }
public void GetScheduleEntriesFromSchedule() { Schedule s = Schedule.GetSchedule(Api, Settings.TestProject, Settings.TestSchedule).Result; ApiList <ScheduleEntry> entries = RunTest(s.GetScheduleEntries(Api)); Assert.IsTrue(entries.All(Api).Any(e => e.id == Settings.TestEvent)); }
public void GetComments() { MessageBoard b = MessageBoard.GetMessageBoard(Api, Settings.TestProject, Settings.TestMessageBoard).Result; Message m = b.GetMessage(Api, Settings.TestMessage).Result; ApiList <Comment> comments = RunTest(m.GetComments(Api)); Assert.IsTrue(comments.All(Api).Any(c => c.id == Settings.TestComment)); }
public void GetPeopleOnProject() { ApiList <Person> people = RunTest(Person.GetPeopleOnProject(Api, Settings.TestProject)); List <Person> all = people.All(Api).ToList(); Assert.IsTrue(all.Any(p => p.id == Settings.LoginUser)); Assert.IsTrue(all.Any(p => p.id == Settings.TestUser)); }
public void GetAllPeople() { ApiList <Person> people = RunTest(Person.GetAllPeople(Api)); List <Person> all = people.All(Api).ToList(); Assert.IsTrue(all.Any(p => p.id == Settings.TestUser)); Assert.IsTrue(all.Any(p => p.id == Settings.TestUser2)); }
public static void ShowList <T>(Task <ApiList <T> > task) { ApiList <T> result = RunTest(task); foreach (T o in result.All(Api)) { Console.WriteLine(o); } }
public static void ShowList <T, L>(Task <L> task) where T : new() where L : ApiList <T> { ApiList <T> result = RunTest(task); foreach (T o in result.All(Api)) { Console.WriteLine(o); } }
public void CreateProjectAndTrash() { if (!Settings.DestructiveTests) { return; } Project p = Project.CreateProject(Api, "Nikki Test 2").Result; RunTest(p.Trash(Api)); ApiList <Project> projects = RunTest(Project.GetAllProjects(Api, Status.trashed)); Assert.IsTrue(projects.All(Api).Any(t => t.id == p.id)); }
public void GetScheduleEntries() { ApiList <ScheduleEntry> entries = RunTest(ScheduleEntry.GetScheduleEntries(Api, Settings.TestProject, Settings.TestSchedule)); Assert.IsTrue(entries.All(Api).Any(e => e.id == Settings.TestEvent)); }
public void GetAllQuestions() { ApiList <Question> list = RunTest(Question.GetAllQuestions(Api, Settings.TestProject, Settings.TestQuestionnaire)); Assert.IsTrue(list.All(Api).Any(q => q.id == Settings.TestQuestion)); }
public void GetAnswers() { ApiList <QuestionAnswer> answers = RunTest(QuestionAnswer.GetAllQuestionAnswers(Api, Settings.TestProject, Settings.TestQuestion)); Assert.IsTrue(answers.All(Api).Any(a => a.id == Settings.TestAnswer)); }
public void GetAllProjects() { ApiList <Project> projects = RunTest(Project.GetAllProjects(Api)); Assert.IsTrue(projects.All(Api).Any(p => p.id == Settings.TestProject)); }
public void GetAllToDoLists() { ApiList <ToDoList> lists = RunTest(ToDoList.GetAllToDoLists(Api, Settings.TestProject, Settings.TestToDoSet)); Assert.IsTrue(lists.All(Api).Any(l => l.id == Settings.TestToDoList)); }
public void GetAllToDoListGroups() { ApiList <ToDoListGroup> groups = RunTest(ToDoListGroup.GetAllToDoListGroups(Api, Settings.TestProject, Settings.TestToDoList)); Assert.IsTrue(groups.All(Api).Any(g => g.id == Settings.TestToDoListGroup)); }
public void GetAllCampfires() { ApiList <Campfire> campfires = RunTest(Campfire.GetAllCampfires(Api)); Assert.IsTrue(campfires.All(Api).Any(c => c.id == Settings.TestCampfire)); }