Esempio n. 1
0
        public void EditClientTest()
        {
            try
            {
                EditClientController ec = new EditClientController();
                JObject s = new JObject();

                s["cust_name"]    = "Vicky";
                s["cust_email"]   = "*****@*****.**";
                s["cust_phone"]   = "1234567890";
                s["cust_address"] = "xyz apartments";
                s["cust_city"]    = "Delhi";
                s["cust_state"]   = "delhi";

                var res = ec.Put(23, s);

                Assert.IsNotNull(res);
                Assert.AreEqual("*****@*****.**", res.cust_email);
            }
            catch (UnitTestAssertException e)
            {
                Assert.Fail("Cant Edit the given Values: " + " " + e.Message);
            }

            catch (NullReferenceException e)
            {
                Assert.Fail("Null values refrenced" + e.Message);
            }

            catch (Exception e)
            {
                Assert.Fail("Some server Error occured: " + e.Message);
            }
        }
Esempio n. 2
0
        public void CantEditClientTest()
        {
            EditClientController ec = new EditClientController();
            JObject s = new JObject();

            s["cust_name"]    = "Vicky";
            s["cust_email"]   = "*****@*****.**";
            s["cust_phone"]   = "1234567890";
            s["cust_address"] = "xyz apartments";
            s["cust_city"]    = "Delhi";
            s["cust_state"]   = "delhi";

            var res = ec.Put(21, s);

            Assert.IsNull(res);
        }