Пример #1
0
 public QUnitTest(string name, bool success, string message, QUnitResultContext context)
 {
     Name    = name;
     Success = success;
     Message = message;
     Context = context;
 }
Пример #2
0
        public override IEnumerable <object[]> GetData(MethodInfo methodUnderTest, Type[] parameterTypes)
        {
            var arguments = GetArguments();
            var json      = GetProcessOutput(arguments);

            ResultData results;

            try
            {
                results = JsonConvert.DeserializeObject <ResultData>(json);
            }
            catch
            {
                throw new Exception(json);
            }

            var context = new QUnitResultContext(
                results.QUnitResult.Total,
                results.QUnitResult.Passed,
                results.QUnitResult.Failed,
                results.QUnitResult.Runtime,
                results.Logs);

            return(results.TestResults
                   .Select(p => new object[] { new QUnitTest(p.Key, p.Value.Success, p.Value.Message, context) })
                   .ToArray());
        }