using KGySoft.CoreLibraries;
using KGySoft.Diagnostics;
public class RandomizedPerformanceTest<T> : PerformanceTestBase<Func<Random, T>, T>
public int Seed { get; set; }
protected override T Invoke(Func<Random, T> del) { return del.Invoke(random); }
protected override void OnBeforeCase() { random = new Random(Seed); }
public static void Main()
new RandomizedPerformanceTest<string>
.AddCase(rnd => tag is not "HouseItem" and not "EditorOnly" and not "Player" and not "CargoBox" ? "t" : "f", "and not")
.AddCase(rnd => !(tag is "HouseItem" or "EditorOnly" or "Player" or "CargoBox") ? "t" : "f", "or")
.AddCase(rnd => !(tag == "HouseItem" || tag == "EditorOnly" || tag == "Player" || tag == "CargoBox") ? "t" : "f", "||")
.AddCase(rnd => !(tag == "HouseItem" && tag == "EditorOnly" && tag == "Player" && tag == "CargoBox") ? "t" : "f", "&&")
.DumpResults(Console.Out);