Exemplo n.º 1
0
  [TestMethod] public void insert_employee() {
    var db = new employee_db();
    var count = db.delete<employee>();
    assert(count > 0);
    
    var employee = new employee();
    employee.email = "*****@*****.**";
    employee.password = "******";
    var id = db.insert(employee);
    assert(id > 1);

    var employees = db.all<employee>();
    assert(employees.Count > 0);
    employee = employees[0];
    assert(employee.password == "password");

    employee.email = "*****@*****.**";
    db.update(employee);

    employee = db.one<employee>("where email='*****@*****.**'");
    assert(employee.email == "*****@*****.**");
  }
Exemplo n.º 2
0
 [TestMethod] public void get_employee() {
   var db = new employee_db();
   var employee = db.one<employee>("where email='*****@*****.**'");
   assert(employee != null);
 }