コード例 #1
0
        public void ShouldDeleteMission()
        {
            Response aResponse = new Response();

            missionRepo.Insert(MISSION1);
            missionRepo.Insert(MISSION2);
            aResponse = missionRepo.Delete(1);

            Assert.IsTrue(aResponse.Success);
        }
コード例 #2
0
        public void ShouldReturnListofMissions()
        {
            Response <List <Mission> > response = new Response <List <Mission> >();


            Mission mission = MissionTesting.MISSION1;

            mission.Agent = new List <Agent>();
            mission.Agent.Add(AGENT1);

            Mission mission1 = MissionTesting.MISSION2;

            mission1.Agent = new List <Agent>();
            mission1.Agent.Add(AGENT1);

            missionRepo.Insert(mission);
            missionRepo.Insert(mission1);

            response = repo.GetMissions(1);
            Assert.AreEqual(2, response.Data.Count);
        }
コード例 #3
0
 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);
     }
 }
コード例 #4
0
        public void DeletingAgencyAndDepedencies()
        {
            Response aResponse = new Response();

            agencyRepo.Insert(AGENCY1);

            AgencyAgent agencyAgent = AgencyAgentTesting.AGENCYAGENT1;

            agencyAgent.Agency = AGENCY1;
            agencyagentRepo.Insert(agencyAgent);

            Mission mission = MissionTesting.MISSION1;

            mission.Agency = AGENCY1;
            missionRepo.Insert(mission);

            aResponse = agencyRepo.Delete(1);

            Assert.IsTrue(aResponse.Success);
        }