Index: Application/Ringtoets/test/Application.Ringtoets.Storage.TestUtil/TestDbSet.cs =================================================================== diff -u -rbc9552772d4e6a6bd786dfcaef808da1964e8c53 -rbb04ea61be6e4ce94cb1453c4578b0e9256168c4 --- Application/Ringtoets/test/Application.Ringtoets.Storage.TestUtil/TestDbSet.cs (.../TestDbSet.cs) (revision bc9552772d4e6a6bd786dfcaef808da1964e8c53) +++ Application/Ringtoets/test/Application.Ringtoets.Storage.TestUtil/TestDbSet.cs (.../TestDbSet.cs) (revision bb04ea61be6e4ce94cb1453c4578b0e9256168c4) @@ -103,5 +103,16 @@ { return collection.GetEnumerator(); } + + public override T Find(params object[] keyValues) + { + var propertyInfo = typeof(T).GetProperty(typeof(T).Name + "Id"); + if (propertyInfo == null) + { + // Naming convention: Primary key of an entity should be named '+Id', but convention is violated: + throw new MissingMemberException(typeof(T).Name, typeof(T).Name + "Id"); + } + return collection.SingleOrDefault(i => propertyInfo.GetValue(i, null).Equals(keyValues[0])); + } } } \ No newline at end of file