Ejemplo n.º 1
0
 public AddressCandidateServiceTest()
 {
     TecAppContext           = new TecAppContext();
     AddressCandidateService = new AddressCandidateService(TecAppContext);
     AddressService          = new AddressService.AddressService(TecAppContext);
     CandidateService        = new EmployeeService.CandidateService(TecAppContext);
 }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
        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);
        }
Ejemplo n.º 4
0
        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;
        }