예제 #1
0
        public void ConfigureTest(string name, TestConfiguration config)
        {
            _logger.LogDebug(name);
            var db          = _dbConnector.GetDatabase();
            var currentTest = _testContext.GetTest(name, dbContext: db);

            if (currentTest == null)
            {
                _logger.LogDebug("test {0} does not exist, creating".FormatWith(name));
                config.Version = 1;

                _testContext.SaveTest(config);
            }
            else
            {
                _logger.LogDebug("test {0} exists, updating".FormatWith(name));
                currentTest.Variants = config.Variants;
                currentTest.Version += 1;

                _testContext.SaveTest(currentTest);
            }
        }