public AddressCandidateServiceTest() { TecAppContext = new TecAppContext(); AddressCandidateService = new AddressCandidateService(TecAppContext); AddressService = new AddressService.AddressService(TecAppContext); CandidateService = new EmployeeService.CandidateService(TecAppContext); }
public void GetTest() { var addressCandidate = AddressCandidateService.GetPairFromAddressAndCandidateId(Address.Id, Candidate.Id); Assert.AreEqual(addressCandidate.AddressId, Address.Id); Assert.AreEqual(addressCandidate.CandidateId, Candidate.Id); Assert.AreEqual(addressCandidate.Id, AddressCandidate.Id); }
public void RemoveTest() { AddressCandidateService.RemoveAddressFromCandidate(AddressCandidate.AddressId, AddressCandidate.CandidateId); var removedAddressCandidate = AddressCandidateService.GetPairFromAddressAndCandidateId(AddressCandidate.AddressId, AddressCandidate.CandidateId); Assert.AreEqual(removedAddressCandidate.Id, -1); AddressService.RemoveAddress(Address); CandidateService.RemoveCandidate(Candidate); }
public void AddTest() { var random = new Random(); var randomAddress = AddressService.AddAddress(new Address()); var randomCandidate = CandidateService.AddCandidate(new Candidate()); var newAddressCandidate = new Address_Candidate() { Candidate = randomCandidate, Address = randomAddress }; AddressCandidate = AddressCandidateService.AddAddressToCandidate(newAddressCandidate); Address = AddressCandidate.Address; Candidate = AddressCandidate.Candidate; }