Esempio n. 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (Session["user"] == null)
                {
                    Response.Redirect("Loginpage2.aspx");
                }
                else
                {
                    c.cmd.CommandText = "Select * from Doctor1 where DoctorID='" + Session["user"].ToString() + "'";
                    c.ds.Clear();
                    c.adp.Fill(c.ds, "vt");
                    Label1.Text = c.ds.Tables["vt"].Rows[0]["DoctorID"].ToString();
                }

                BindDropDownList();
            }
            //unit test for apply for leave
            WelcomeDoctorUnittest wd = new WelcomeDoctorUnittest();

            Response.Write(wd.docid);
            Response.Write(wd.startdate);
            Response.Write(wd.starttime);
            Response.Write(wd.enddate);
            Response.Write(wd.endtime);
            Response.Write(wd.imagepath);
            //unit test ends
        }
        public void TestMethod2()
        {
            WelcomeDoctorUnittest ob = new WelcomeDoctorUnittest();

            Assert.AreEqual("doc1", ob.doctid);
            Assert.AreEqual("pt1", ob.patientId);
            Assert.AreEqual(Convert.ToDateTime("11-04-2019 01:00:00"), ob.day);
            Assert.AreEqual("~/ images / Screenshot(108).png", ob.imagepath);
        }
        public void TestMethod1()
        {
            //WelcomeDoctor Unit test for uploading Leaves
            //unit test for testing the format of time
            WelcomeDoctorUnittest ob = new WelcomeDoctorUnittest();

            Assert.AreEqual("doc1", ob.docid);
            Assert.AreEqual("11/27/2019", ob.startdate);
            Assert.AreEqual("12/27/2019", ob.enddate);
            Assert.AreEqual("00:00:00", ob.starttime);
            Assert.AreEqual("00:00:00", ob.endtime);
            // Assert.AreEqual("~/ images / Screenshot(108).png",ob.imagepath);
        }