Ejemplo n.º 1
0
 public void FindByNameMarek()
 {
     Mock<IPersonRepository> MockRepo = ListPerson(0);
     ServiceOfPerson Service = new ServiceOfPerson(MockRepo.Object);
     List<Person> ListOfPerson = Service.FindByName("Marek");
     Assert.AreEqual(0, ListOfPerson.Count);
 }
Ejemplo n.º 2
0
 public void CheckListIsNotNull()
 {
     Mock<IPersonRepository> MockRepo = ListPerson(18);
     ServiceOfPerson Service = new ServiceOfPerson(MockRepo.Object);
     List<Person> ListOfPerson = Service.AdultPerson();
     List<Person> p1 = ListOfPerson;
     Assert.IsNotNull(p1);
 }
Ejemplo n.º 3
0
 public void FindByNameFirstMockTomek()
 {
     Mock<IPersonRepository> MockRepo = ListPerson(0);
     ServiceOfPerson Service = new ServiceOfPerson(MockRepo.Object);
     List<Person> ListOfPerson = Service.FindByName("MockTomek");
     Assert.AreEqual(1, ListOfPerson.Count);
     Person p1 = ListOfPerson.First();
     Assert.AreEqual("MockTomek", p1.FirstName);
 }
Ejemplo n.º 4
0
 public void FindAdultPerson()
 {
     Mock<IPersonRepository> MockRepo = ListPerson(18);
     ServiceOfPerson Service = new ServiceOfPerson(MockRepo.Object);
     List<Person> ListOfPerson = Service.AdultPerson();
     Assert.AreEqual(2, ListOfPerson.Count);
     List<Person> p1 = ListOfPerson;
     Assert.AreEqual(p1, p1);
 }
Ejemplo n.º 5
0
 public void FindPersonByAge20()
 {
     Mock<IPersonRepository> MockRepo = ListPerson(20);
     ServiceOfPerson Service = new ServiceOfPerson(MockRepo.Object);
     List<Person> ListOfPerson = Service.FindByAge(20);
     Assert.AreEqual(2, ListOfPerson.Count);
     Person p1 = ListOfPerson.First();
     Assert.AreEqual("MockBartek", p1.FirstName);
     Assert.AreEqual(true, p1.Age >= 20);
 }