Пример #1
0
        public void Test_fieldProperty()
        {
            Employee newSampleClass = new Employee {
                _id = 2, EmployeeName = "Manjushree"
            };

            Microsoft.VisualStudio.TestTools.UnitTesting.PrivateObject pobject = new Microsoft.VisualStudio.TestTools.UnitTesting.PrivateObject(newSampleClass);

            Assert.AreEqual <int?>(2, pobject.GetFieldOrProperty("_id") as int?);
            Assert.AreEqual <string>("Manjushree", pobject.GetFieldOrProperty("EmployeeName") as string);
        }
Пример #2
0
 public void TestLoginSuccess()
 {
     AllDebrid all = new AllDebrid(username: this.username, password: this.password);
     PrivateObject obj = new Microsoft.VisualStudio.TestTools.UnitTesting.PrivateObject(all);
     var result = obj.Invoke("Login", this.username, this.password);
     var attrCookie = obj.GetFieldOrProperty("_cookie");
     var attrDaysLeft = obj.GetFieldOrProperty("daysLeft");
     Assert.IsNotNull(attrCookie);
     Assert.IsTrue((bool)result);
     Assert.IsNotNull(attrDaysLeft);
     
 }
Пример #3
0
        public void TestLoginSuccess()
        {
            AllDebrid     all          = new AllDebrid(username: this.username, password: this.password);
            PrivateObject obj          = new Microsoft.VisualStudio.TestTools.UnitTesting.PrivateObject(all);
            var           result       = obj.Invoke("Login", this.username, this.password);
            var           attrCookie   = obj.GetFieldOrProperty("_cookie");
            var           attrDaysLeft = obj.GetFieldOrProperty("daysLeft");

            Assert.IsNotNull(attrCookie);
            Assert.IsTrue((bool)result);
            Assert.IsNotNull(attrDaysLeft);
        }