/// <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); } } } } }
/// <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); }
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(); }
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); }
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); }
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; }
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; }
public TestCasesController(ITestCaseRepository repository) { _repository = repository; }
public TestSuiteController(ITestCaseRepository repository) { this.repository = repository; }
public TestSuiteControllerTest() { this.testCases = new List <TestCase>(); this.testCaseRepository = Mock.Of <ITestCaseRepository>(r => r.FetchAll() == testCases); this.controller = new TestSuiteController(testCaseRepository); }
public TestCaseExecution AddExecution(string definition, ITestCaseRepository repository) { return(AddExecution(definition, repository, new TestStepFactory())); }
public SystemController(ITestCaseRepository noteRepository) { _noteRepository = noteRepository; }
public TestCaseService(ITestCaseRepository testCaseRepository, IUnitOfWork unitOfWork, ILogger <FolderService> logger) { this._testCaseRepository = testCaseRepository; _unitOfWork = unitOfWork; _logger = logger; }
public TestCaseService(ITestCaseRepository testCaseRepository) { _testCaseRepository = testCaseRepository; }
public TestCaseAppService(ITestCaseRepository repository, ITestSuiteAppService testSuiteApp) { __repository = repository; __testSuiteApp = testSuiteApp; }
public TestCasesController(IMapper mapper, IUnitOfWork unitOfWork, ITestCaseRepository repository) { this._unitOfWork = unitOfWork; this._mapper = mapper; this._repository = repository; }
public TestCaseController(ITestCaseRepository testCaseRepository, IFolderRepository folderRepository, ILogger <TestCaseController> logger) { _testCaseRepository = testCaseRepository; _folderRepository = folderRepository; _logger = logger; }
public TestsController(ITestCaseRepository testRepository) { _testRepository = testRepository; }
public TestCaseController(ITestCaseRepository testCaseRepo) { _testCaseRepository = testCaseRepo; }
public void Create(ITestCaseRepository repository) { repository.Create(this); }
public TestCaseCommandHandler(ITestCaseRepository testCaseRepository, IMediator mediator) { _testCaseRepository = testCaseRepository; _mediator = mediator; }
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; }