private List <Operator> GetOperators() { OperatorRepository operatorRepository = new OperatorRepository(this.UnitOfWork); var operators = operatorRepository.GetAll(); return(operators.ToList()); }
public void OperatorsLoad() { using (IUnitOfWork uow = UnitOfWorkFactory.Create()) { OperatorRepository operatorRepository = new OperatorRepository(uow); var operators = operatorRepository.GetAll(); foreach (Operator op in operators) { long identity = op.Id; Operator wfOperator = operatorRepository.GetById(identity); Assert.Equal(op.GetSummary(), wfOperator.GetSummary()); } } }
public void OperatorUpdate() { using (IUnitOfWork uow = UnitOfWorkFactory.Create()) { OperatorRepository operatorRepository = new OperatorRepository(uow); var operators = operatorRepository.GetAll(); if (operators.Count > 0) { Operator myoperator = operators.FirstOrDefault(); myoperator.EMail += " (up)"; operatorRepository.Update(myoperator); } } }
public void MissionInsert() { using (IUnitOfWork uow = UnitOfWorkFactory.Create()) { ActivityRepository activityRepository = new ActivityRepository(uow); OperatorRepository operatorRepository = new OperatorRepository(uow); MissionRepository missionRepository = new MissionRepository(uow); var fA = activityRepository.GetAll().FirstOrDefault(); var fO = operatorRepository.GetAll().FirstOrDefault(); Mission newMission = new Mission() { Description = "OnlyForTest", WFOperator = fO, Activity = fA, StartDate = DateTime.Now }; missionRepository.Insert(newMission); } }