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); }
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); }
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); }
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); }
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); }