-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
executable file
·41 lines (34 loc) · 1.15 KB
/
Program.cs
File metadata and controls
executable file
·41 lines (34 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
using PrettyConsole;
using PrettyConsole.Tests;
using PrettyConsole.Tests.Features;
using static PrettyConsole.Console;
// var assembly = Assembly.GetExecutingAssembly();
// var tests = assembly.GetTypes()
// .Where(x => x.GetInterfaces().Contains(typeof(IPrettyConsoleTest)))
// .Select(x => (IPrettyConsoleTest)Activator.CreateInstance(x)!)
// .ToArray();
var tests = new IPrettyConsoleTest[] {
new ColoredOutputTest(),
new SelectionTest(),
new MultiSelectionTest(),
new TableTest(),
new TreeMenuTest(),
new IndeterminateProgressBarTest(),
new ProgressBarDefaultTest(),
new ProgressBarMultiLineTest(),
new MultiProgressBarTest(),
};
foreach (var test in tests) {
await test.Render();
NewLine();
}
#pragma warning disable CS8321 // Local function is declared but never used
static void Measure(string label, Action action) {
long before = GC.GetAllocatedBytesForCurrentThread();
action();
long after = GC.GetAllocatedBytesForCurrentThread();
NewLine();
WriteLine($"{label} - allocated {after - before} bytes");
NewLine();
}
#pragma warning restore CS8321 // Local function is declared but never used