public static int Report(AwesomeInventoryUnitTest tests, ref StringBuilder sb, string indent = "")
        {
            int num = 0;

            if (tests == null || sb == null)
            {
                return(0);
            }

            if (!tests.Tests.Any())
            {
                return(1);
            }

            sb.Append(indent);
            sb.AppendLine(string.Format(StringResource.NumberOfChildrenTests, tests.FullName, tests.Tests.Count));
            foreach (AwesomeInventoryUnitTest test in tests.Tests)
            {
                sb.Append(indent);
                sb.Append(StringResource.Indent);
                sb.AppendLine(string.Format(StringResource.KeyValuePair, test.FullName, tests.TestResults[test.FullName]));
                num += Report(test, ref sb, string.Concat(indent, StringResource.Indent));
            }

            sb.AppendLine();
            if (indent.NullOrEmpty())
            {
                sb.AppendLine(string.Format(StringResource.TotalTests, num));
            }

            return(num);
        }
Ejemplo n.º 2
0
        private void Start()
        {
            try
            {
                Root.Start();
            }
            catch (Exception e)
            {
                Log.Error(e.Message + e.StackTrace);
            }

            StringBuilder sb = new StringBuilder();

            AwesomeInventoryUnitTest.Report(Root, ref sb);
            Log.Warning(sb.ToString());
        }