Пример #1
0
 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);
 }
Пример #2
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);
     }
 }
Пример #3
0
 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
 }
Пример #4
0
 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);
 }
Пример #5
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);
     }
 }
Пример #6
0
        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());
                }
            }
        }
Пример #7
0
 public void CleanupTest()
 {
     var tester = new TestUtils(new CSBCDbContext());
     tester.CleanupDb();
 }
Пример #8
0
 public void TestCleanup()
 {
     var context = new CSBC.Core.Data.CSBCDbContext();
     var tester = new TestUtils(context);
     tester.CleanupDb();
 }
Пример #9
0
 public void InitTest()
 {
     var tester = new TestUtils(new CSBCDbContext());
     tester.InitColors(new CSBCDbContext());
 }