public void GetPersonByFirstAndLastNameTest() { var context = new Core.Data.CSBCDbContext(); var testinit = new TestUtils(context); var rep = new PersonRepository(context); var person = rep.FindPersonByLastAndFirstName(testinit.HouseholdLastNames[0], testinit.FirstNames[0]); Assert.IsTrue(person.PeopleID != 0); }
public void GetEmailGroupTest() { using (var context = new CSBCDbContext()) { var testinit = new TestUtils(context); var rep = new PersonRepository(context); //var people = rep.GetByGroup(1, testinit); } }
public void GetUserAccessTest() { var dataContext = new CSBCDbContext(); var tester = new TestUtils(dataContext); var rep = new UserRepository(new CSBCDbContext()); var user = dataContext.Users.FirstOrDefault(n => (n.UserName == (tester.HouseholdLastNames[0] + "1")) && (n.PWord == tester.HouseholdLastNames[0])); Assert.IsTrue(user.HouseID != 0); //return user.SeasonID }
public void GetPersonByIdTest() { var context = new Core.Data.CSBCDbContext(); var testinit = new TestUtils(context); var rep = new PersonRepository(context); var people = rep.GetAll(1); var person5 = people.ElementAt<Person>(5); //assume at least 5 people in table var id = person5.PeopleID; var person = rep.GetById(id); Assert.IsTrue(person.PeopleID != 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); } }
public void GetParentsTest() { using (var context = new Core.Data.CSBCDbContext()) { var testinit = new TestUtils(context); var rep = new PersonRepository(context); var person = context.People.FirstOrDefault(); if (person != null) { var parents = rep.GetParents(person.PeopleID); Assert.IsTrue(person.PeopleID != 0); Assert.IsTrue(parents.Any()); } } }
public void CleanupTest() { var tester = new TestUtils(new CSBCDbContext()); tester.CleanupDb(); }
public void TestCleanup() { var context = new CSBC.Core.Data.CSBCDbContext(); var tester = new TestUtils(context); tester.CleanupDb(); }
public void InitTest() { var tester = new TestUtils(new CSBCDbContext()); tester.InitColors(new CSBCDbContext()); }