public static void Assert(this Marking m, Dictionary<int, string> names, Dictionary<string, int> expected) { foreach (var kvp in expected) { int idx = names.Where(x => x.Value == kvp.Key).Select(x => x.Key).Single(); NUnit.Framework.Assert.AreEqual(kvp.Value, m[idx]); } }