Beispiel #1
0
        public void TestLogin()
        {
            EmployDetails pobj = new EmployDetails();
            string        x    = pobj.Login("Ajit", "1234");
            string        y    = pobj.Login("", "");
            string        z    = pobj.Login("Admin", "Admin");

            Assert.AreEqual("Userid or password could not be Empty.", y);
            Assert.AreEqual("Incorrect UserId or Password.", x);
            Assert.AreEqual("Welcome Admin.", z);
        }
Beispiel #2
0
        public void Getuserdetails()
        {
            EmployDetails pobj = new EmployDetails();
            var           p    = pobj.GetDetails(100);

            foreach (var x in p)
            {
                Assert.AreEqual(x.Id, 100);
                Assert.AreEqual(x.Name, "Bharat");
            }
        }
Beispiel #3
0
        public void Checkdetails()
        {
            EmployDetails pobj = new EmployDetails();

            list = pobj.AllUsers();
            foreach (var x in list)
            {
                Assert.IsNotNull(x.Id);
                Assert.IsNotNull(x.Name);
                Assert.IsNotNull(x.Salary);
                Assert.IsNotNull(x.Gender);
            }
        }
Beispiel #4
0
        public List <EmployDetails> GetDetails(int id)
        {
            List <EmployDetails> li1 = new List <EmployDetails>();
            var li = new EmployDetails().AllUsers();

            foreach (var x in li)
            {
                if (x.Id == id)
                {
                    li1.Add(x);
                }
            }
            return(li1);
        }