Esempio n. 1
0
        public void AddTest(string description, string code)
        {
            var lastSuite = _suites.LastOrDefault();

            if (lastSuite == null)
            {
                throw new TestException($"No test suite has been created, cannot define test: {code}");
            }

            var deterministicId = _deterministicIdentifier.GetIdentifier(lastSuite.Name, description);

            var test = new Test
            {
                Result  = _resultFactory.Indeterminate(),
                Name    = description,
                Id      = deterministicId,
                Suite   = lastSuite,
                RawCode = code
            };

            lastSuite.Tests.Add(test);
        }