Esempio n. 1
0
 public void GetUserByHouseholdIDTest()
 {
     using (var db = new CSBCDbContext())
     {
         var tester = new TestUtils(db);
         var house = new HouseholdRepository(db).GetByName(tester.HouseholdLastNames[1]).First<Household>();
         var rep = new UserRepository(db);
         var user = rep.GetUserByHouseId(house.HouseID);
         Assert.IsTrue(user != null);
     }
 }
Esempio n. 2
0
 private string GetUserNameByHouseholdId(int houseId)
 {
     using (var db = new CSBCDbContext())
     {
         var rep = new UserRepository(db);
         var user = rep.GetUserByHouseId(houseId);
         if (user == null)
             return String.Empty;
         else
             return user.UserName;
     }
 }