2using System.Reflection;
3using System.Runtime.CompilerServices;
4using System.Collections.Generic;
5using System.Collections.Immutable;
10using Microsoft.Xna.Framework;
11using Microsoft.Xna.Framework.Graphics;
20 public partial class ComponentTest : FillMethods
24 public static void PrintCoverage()
26 Assembly targetAssembly = Assembly.GetAssembly(typeof(ComponentTest));
28 IEnumerable<Type> componentTypes = targetAssembly.GetTypes().Where(T => T.IsSubclassOf(typeof(
CUIComponent)) && T.DeclaringType ==
null);
30 IEnumerable<MethodInfo> testMethods = typeof(ComponentTest).GetMethods().Where(mi => FillMethods.IsTestMethod(mi));
32 Dictionary<string, bool> IsCovered =
new Dictionary<string, bool>();
34 foreach (MethodInfo mi
in testMethods)
36 IsCovered[mi.Name] =
true;
39 foreach (Type T
in componentTypes)
41 bool covered = IsCovered.GetValueOrDefault(T.Name);
42 Color cl = covered ? Color.Lime : Color.Red;
Base class for all components.