private static void GetAllDentists()
 {
     IRequestResponse irr = new HttpGetAllDentist();
     TemplateJson     ts  = new JsonAllDentists();
     var test             = irr.GetResponse();
     var dentistser       = ts.GetObject(test);
 }
        public void JsonAllDentistsObjectToJsonTest()
        {
            TemplateJson tl       = new JsonAllDentists();
            var          dentists = new List <Dentist>();

            dentists.Add(new Dentist(id1, name1, email1, phone1));
            dentists.Add(new Dentist(id2, name2, email2, phone2));
            var json = tl.GetJson(dentists);

            Assert.AreEqual(correctJson, json);
        }
        public void JsonAllDentistsObjectToJsonInvalidTest()
        {
            bool         exception = false;
            TemplateJson tl        = new JsonAllDentists();

            try
            {
                var json = tl.GetJson("I am the wrong object");
            }
            catch (InvalidLoginObjectException)
            {
                exception = true;
            }

            Assert.IsTrue(exception);
        }
        public void JsonAllDentistsJsonToObjectInvalidTest()
        {
            bool         exception = false;
            var          incorrect = "{\"emails\":\"[email protected]\",\"password\":\"Password\"}";
            TemplateJson tl        = new JsonAllDentists();

            try
            {
                var o = tl.GetObject(incorrect) as List <Dentist>;
            }
            catch (Exception)
            {
                exception = true;
            }

            Assert.IsTrue(exception);
        }
        public void JsonAllDentistsJsonToObjectTest()
        {
            TemplateJson tl = new JsonAllDentists();
            var          o  = tl.GetObject(correctJson) as List <Dentist>;
            var          d1 = o[0];
            var          d2 = o[1];

            Assert.AreEqual(id1, d1.GetID());
            Assert.AreEqual(name1, d1.GetName());
            Assert.AreEqual(email1, d1.GetEmail());
            Assert.AreEqual(phone1, d1.GetPhone());

            Assert.AreEqual(id2, d2.GetID());
            Assert.AreEqual(name2, d2.GetName());
            Assert.AreEqual(email2, d2.GetEmail());
            Assert.AreEqual(phone2, d2.GetPhone());
        }
        protected override void ThreadMethod()
        {
            try
            {
                var response = GetJsonResponse(new JsonAllDentists(), new HttpGetAllDentist(), information);
                var dentists = new JsonAllDentists();

                dentistsList = dentists.GetObject(response) as List <Dentist>;
                ThreadComplete(true);
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine(ex.StackTrace);

                dentistsList = null;
                ThreadComplete(false);
            }
        }