示例#1
0
 /// <summary>
 /// Update testcases
 /// </summary>
 /// <param name="testRepository"></param>
 /// <param name="testCaseList"></param>
 private void UpdateTestCases
     (ITestCaseRepository <TestCaseModel> testRepository, IList <TestCaseModel> testCaseList)
 {
     foreach (TestCaseModel testCaseModel in testCaseList)
     {
         TestCaseModel caseModel = testRepository.GetByName(testCaseModel.TestCaseName);
         if (caseModel != null)
         {
             if (testCaseModel.TestCategory != caseModel.TestCategory ||
                 testCaseModel.TestCaseDescription != caseModel.TestCaseDescription ||
                 testCaseModel.TestCasePriority != caseModel.TestCasePriority ||
                 testCaseModel.DependentTestCaseName != caseModel.DependentTestCaseName ||
                 testCaseModel.Order != caseModel.Order ||
                 testCaseModel.IsActive != caseModel.IsActive)
             {
                 testRepository.GetId(testCaseModel.TestCaseName);
                 UpdateResult result = testRepository.Update(testCaseModel);
                 if (result.IsAcknowledged)
                 {
                     Logger.log.Debug("TestCase is updataed Successfully:" + testCaseModel.TestCaseName);
                 }
                 else
                 {
                     throw new MongoException("Updating of testCase failed:" + testCaseModel.TestCaseName);
                 }
             }
         }
     }
 }
示例#2
0
        /// <summary>
        /// Is dependent testcase is executed
        /// </summary>
        /// <param name="testCaseName"></param>
        /// <returns></returns>
        private bool IsDependentTestCaseExecuted(string testCaseName)
        {
            bool isDependencyTestCaseExecuted = false;

            ITestCaseRepository <TestCaseModel> testCaseRepository = mongoRepository.GetTestCaseRepository;
            TestCaseModel testCaseModel = testCaseRepository.GetByName(testCaseName);

            if (testCaseModel.DependentTestCaseName != null)
            {
                ObjectId objectId = testCaseRepository.GetId(testCaseModel.DependentTestCaseName);
                if (objectId != null)
                {
                    TestResultModel testResultModel = mongoRepository.GetTestResultRepository
                                                      .GetTestResultsByTestCaseId(objectId)
                                                      .FirstOrDefault();
                    if (testResultModel.Result.Equals(TestResult.Passed.ToString()))
                    {
                        isDependencyTestCaseExecuted = true;
                    }
                }
            }
            else
            {
                isDependencyTestCaseExecuted = true;
            }

            return(isDependencyTestCaseExecuted);
        }
示例#3
0
        public AbstractTestConfigManager(TestConfig TestConfig, IObjectFactory Factory)
        {
            this.TestConfig     = TestConfig;
            this.Agent          = Factory;
            _testCaseRepository = this.Agent.GetTestCaseRepository(this.TestConfig);
            _testRunner         = this.Agent.GetTestRunnerByTestConfig(this.TestConfig);
            _reportProcessor    = this.Agent.GetReportManagerByTestConfig(this.TestConfig);

            this.Agent.LogUtil.LogMessage(string.Format("Filtering test cases for {0} ...", TestConfig.ID));
            this.FillDataMembersRelatedToTestCaseSelectionCriteria();
        }
示例#4
0
        public TestCaseExecution AddExecution(string definition, ITestCaseRepository repository, ITestStepFactory factory)
        {
            var timeStamp         = DateTime.Now.ToTimeStamp();
            var testCaseExecution = new TestCaseExecution();

            testCaseExecution.Name  = $"TestCase_{timeStamp}";
            testCaseExecution.Steps = GetTestSteps(definition, factory);

            repository.AddExecution(this.Name, testCaseExecution);
            this.executions.Insert(0, testCaseExecution);

            return(testCaseExecution);
        }
示例#5
0
        public TestCaseDefinition AddDefinition(string definition, ITestCaseRepository repository)
        {
            var timeStamp          = DateTime.Now.ToTimeStamp();
            var testCaseDefinition = new TestCaseDefinition();

            testCaseDefinition.Name       = $"Definition_{timeStamp}";
            testCaseDefinition.Definition = definition;

            repository.AddDefinition(this.Name, testCaseDefinition);
            this.definitions.Insert(0, testCaseDefinition);

            return(testCaseDefinition);
        }
示例#6
0
        public TestCaseControllerUnitTests()
        {
            var serviceProvider = new ServiceCollection()
                                  .AddLogging()
                                  .BuildServiceProvider();

            var factory = serviceProvider.GetService <ILoggerFactory>();

            _logger = factory.CreateLogger <TestCaseController>();

            _serviceTest   = new TestcaseServiceFake();
            _serviceFolder = new FolderServiceFake();
            _controller    = new TestCaseController(_serviceTest, _serviceFolder, _logger);
        }
 public AdminSettingBusiness(
     IAdminSettingRepository repository,
     IMapper mapper,
     IResultRepository resultRepository,
     ISubmissionRepository submissionRepository,
     IProblemRepository problemRepository,
     ITestCaseRepository testCaseRepository,
     IAccountRepository accountRepository,
     ISubmissionCacheBusiness submissionCacheBusiness,
     IProblemCacheBusiness problemCacheBusiness,
     IAdminSettingCacheBusiness adminSettingCacheBusiness
     ) : base(repository, mapper)
 {
     _downloadUrl               = "/{0}/problems/{0}/0.in";
     _rankUrl                   = "/{0}/ranks/";
     _resultRepository          = resultRepository;
     _submissionRepository      = submissionRepository;
     _problemRepository         = problemRepository;
     _testCaseRepository        = testCaseRepository;
     _accountRepository         = accountRepository;
     _submissionCacheBusiness   = submissionCacheBusiness;
     _problemCacheBusiness      = problemCacheBusiness;
     _adminSettingCacheBusiness = adminSettingCacheBusiness;
 }
示例#8
0
 public SingleTestCaseQuery(ITestCaseRepository repository)
 {
     _repository = repository;
 }
 public DDDController(ILogger <DDDController> logger, IMediator mediator, ITestCaseRepository testCaseRepository)
 {
     _logger             = logger;
     _mediator           = mediator;
     _testCaseRepository = testCaseRepository;
 }
 public TestCasesController(ITestCaseRepository projectRepository)
 {
     _testCaseRepository = projectRepository;
 }
示例#11
0
 public TestCasesController(ITestCaseRepository repository)
 {
     _repository = repository;
 }
示例#12
0
 public TestSuiteController(ITestCaseRepository repository)
 {
     this.repository = repository;
 }
示例#13
0
 public TestSuiteControllerTest()
 {
     this.testCases          = new List <TestCase>();
     this.testCaseRepository = Mock.Of <ITestCaseRepository>(r => r.FetchAll() == testCases);
     this.controller         = new TestSuiteController(testCaseRepository);
 }
示例#14
0
 public TestCaseExecution AddExecution(string definition, ITestCaseRepository repository)
 {
     return(AddExecution(definition, repository, new TestStepFactory()));
 }
示例#15
0
 public SystemController(ITestCaseRepository noteRepository)
 {
     _noteRepository = noteRepository;
 }
 public TestCaseService(ITestCaseRepository testCaseRepository, IUnitOfWork unitOfWork, ILogger <FolderService> logger)
 {
     this._testCaseRepository = testCaseRepository;
     _unitOfWork = unitOfWork;
     _logger     = logger;
 }
示例#17
0
 public TestCaseService(ITestCaseRepository testCaseRepository)
 {
     _testCaseRepository = testCaseRepository;
 }
示例#18
0
 public TestCaseAppService(ITestCaseRepository repository, ITestSuiteAppService testSuiteApp)
 {
     __repository   = repository;
     __testSuiteApp = testSuiteApp;
 }
示例#19
0
 public TestCasesController(IMapper mapper, IUnitOfWork unitOfWork, ITestCaseRepository repository)
 {
     this._unitOfWork = unitOfWork;
     this._mapper     = mapper;
     this._repository = repository;
 }
示例#20
0
 public TestCaseController(ITestCaseRepository testCaseRepository, IFolderRepository folderRepository, ILogger <TestCaseController> logger)
 {
     _testCaseRepository = testCaseRepository;
     _folderRepository   = folderRepository;
     _logger             = logger;
 }
示例#21
0
 public TestsController(ITestCaseRepository testRepository)
 {
     _testRepository = testRepository;
 }
示例#22
0
 public TestCaseController(ITestCaseRepository testCaseRepo)
 {
     _testCaseRepository = testCaseRepo;
 }
示例#23
0
 public void Create(ITestCaseRepository repository)
 {
     repository.Create(this);
 }
示例#24
0
 public TestCaseCommandHandler(ITestCaseRepository testCaseRepository, IMediator mediator)
 {
     _testCaseRepository = testCaseRepository;
     _mediator           = mediator;
 }
示例#25
0
 public TestCaseControllerTest()
 {
     this.testCase           = new TestCase();
     this.testCaseRepository = Mock.Of <ITestCaseRepository>(r => r.Get(It.IsAny <string>()) == testCase);
     this.controller         = new TestCaseController(testCaseRepository);
 }
 public TestCaseQueryHandler2(ITestCaseRepository testCaseRepository)
 {
     _testCaseRepository = testCaseRepository;
 }