Inheritance: ISchooxService
 public void SchooxServiceTestManualCredentials()
 {
     var service = new SchooxService("testschoox", 1);
     Assert.AreEqual(service.AcademyId, 1);
     Assert.AreEqual(service.ApiKey, "testschoox");
     Assert.AreEqual(service.BaseUrl, "https://www.schoox.com/api/v1");
 }
 public void SchooxServiceTestCredentialsFromConfig()
 {
     var service = new SchooxService();
     Assert.AreEqual(service.AcademyId, 386);
     Assert.AreEqual(service.ApiKey, "schoox");
     Assert.AreEqual(service.BaseUrl, "https://www.schoox.com/api/v1");
 }
        public void GenerateBaseRequestTest()
        {
            var service = new SchooxService();
            var request = service.GenerateBaseRequest("/test");

            Assert.IsNotNull(request.Parameters.Find(u => u.Name == "apikey" && (string)u.Value == "schoox"));
            Assert.IsNotNull(request.Parameters.Find(u => u.Name == "acadId" && u.Value.ToString() == "386"));
        }
Example #4
0
        static void Main(string[] args)
        {
            //note the App.config file that has the values for auto loading the configuration
            var schooxService = new SchooxService();

            var dashboard = new Dashboard(schooxService);
            var courses = new Courses(schooxService);

            //lets get the courses
            var coursesResponse = dashboard.GetCourses(Roles.SchooxInternalEmployee);

            if (coursesResponse.RequestSuccessful && coursesResponse.Data != null)
            {
                Console.WriteLine("Request from\n{0}\n{1} courses returned:", coursesResponse.Response.ResponseUri,
                    coursesResponse.Data.Count);

                foreach (var course in coursesResponse.Data)
                {
                    Console.WriteLine("#{0} - {1} - # of Students: {2}", course.Id, course.Title, course.Students);
                }

                //now that we have the courses, let's pull details for the first one
                var firstCourse = coursesResponse.Data.FirstOrDefault();

                if (firstCourse != null)
                {
                    var courseDetail = courses.GetDetailsForCourse(firstCourse.Id);
                    Console.WriteLine("\nDetails for Course:\n{0}", courseDetail.Data);
                }
            }
            else
            {
                Console.WriteLine("No courses found or data null for \"{0}\" courses, check the URL\n{1}.", Roles.SchooxInternalEmployee,
                    coursesResponse.Response.ResponseUri);
            }

            Console.Read();
        }
Example #5
0
 public Exams()
 {
     SService = new SchooxService();
 }
Example #6
0
 public Dashboard()
 {
     SService = new SchooxService ();
 }
Example #7
0
 public Curriculums()
 {
     SService = new SchooxService();
 }
Example #8
0
 public Users()
 {
     SService = new SchooxService();
 }
Example #9
0
 public Courses()
 {
     SService = new SchooxService();
 }