public void BatchUpsert_With_Entities_And_BatchSize_And_BreakFunction_And_Invalid_ResourceId_Throws_ArgumentOutOfRangeException(string input) { IEnumerable <object> payload = Enumerable.Empty <object>(); Func <IEnumerable <object>, object, bool> breakFunc = (l, s) => false; //call ToList to ensure the IEnumerable is executed mockClient.BatchUpsert(payload, 1, breakFunc, input).ToList(); }