public void XingRecruiter3000_can_recruit_Person() { XINGRecruiter3000 r = new XINGRecruiter3000(); var person = r.RecruitPerson(); person.Should().NotBeNull(); }
public void RecruitPersonsAndSaveIntoDB_can_recruit_5_Persons_FOR_REAL() { IRepository repository = new EFRepository(new EFContext(connectionString)); IDevice device = new XINGRecruiter3000(); // Echte Hardware Core core = new Core(device, repository); int numberOfPersons = 5; core.RecruitPersonsAndSaveIntoDB(numberOfPersons); // Test, ob die neuen Elemente aus der Maschine in der echten DB sind var savedPersons = repository.GetAll <Person>(); savedPersons.Should().HaveCount(numberOfPersons); }
public void RecruitPersonsAndSaveIntoDB_can_recruit_5_Persons_with_Hardware_and_save_all_into_Database() { Mock <IRepository> repoMock = new Mock <IRepository>(); IDevice device = new XINGRecruiter3000(); // Echte Hardware Core core = new Core(device, repoMock.Object); int numberOfPersons = 5; core.RecruitPersonsAndSaveIntoDB(numberOfPersons); // Test, ob die "real von der Maschine" erzeugten Objekte "gespeichert" werde repoMock.Verify(x => x.Add <Person>(It.IsAny <Person>()), Times.Exactly(5)); // Verifiziere dass gespeichert wird repoMock.Verify(x => x.Save(), Times.Once()); }