private static Func <string, string> GetComparerForWriterTestExpectedResults(BatchWriterUtils.ODataPayload odataPayload)
        {
            if (odataPayload.TestConfiguration.Format == ODataFormat.Atom)
            {
                return((observed) =>
                {
                    string error;
                    if (!TestWriterUtils.CompareAtomResults(
                            ((AtomWriterTestExpectedResults)odataPayload.WriterTestExpectedResults),
                            observed,
                            odataPayload.TestConfiguration,
                            out error))
                    {
                        return error;
                    }

                    return null;
                });
            }

            if (odataPayload.TestConfiguration.Format == ODataFormat.Json)
            {
                return((observed) =>
                {
                    string error;
                    if (!TestWriterUtils.CompareJsonResults(
                            ((JsonWriterTestExpectedResults)odataPayload.WriterTestExpectedResults),
                            observed,
                            odataPayload.TestConfiguration,
                            out error))
                    {
                        return error;
                    }

                    return null;
                });
            }

            throw new NotSupportedException("Only ATOM and JSON formats are supported for batch payloads.");
        }