public static void Check() { foreach (var testObject in TestObjects) { if (!File.Exists(testObject.ObjectPath)) { throw new Exception("Expected file " + testObject.ObjectPath + " was not found!"); } try { var objectContents = gitHelper.Command("show", testObject.ObjectId); if (objectContents != testObject.Contents) { throw new Exception("Expected object " + testObject.ObjectId + " to be " + testObject.Contents.Inspect() + " but it was " + objectContents.Inspect()); } } catch (GitCommandException e) { throw new Exception("Unable to read object " + testObject.ObjectId + ".", e); } } }