// Path: ersatz/src/test/java/io/github/cjstehno/ersatz/TestAssertions.java
// static void verifyEqualityAndHashCode(final Object instanceA, final Object instanceB) {
//     assertThat(instanceA, equalTo(instanceA));
//     assertThat(instanceB, equalTo(instanceB));
//     assertThat(instanceA, equalTo(instanceB));
//     assertThat(instanceB, equalTo(instanceA));
//     assertThat(instanceA, not(equalTo(null)));
//     assertThat(instanceB, not(equalTo(null)));
//     assertThat(instanceA.hashCode(), equalTo(instanceA.hashCode()));
//     assertThat(instanceB.hashCode(), equalTo(instanceB.hashCode()));
//     assertThat(instanceA.hashCode(), equalTo(instanceB.hashCode()));
//     assertThat(instanceB.hashCode(), equalTo(instanceA.hashCode()));
// }
// 
// Path: ersatz/src/main/java/io/github/cjstehno/ersatz/cfg/ContentType.java
// public static final ContentType IMAGE_PNG = new ContentType("image/png");
// 
// Path: ersatz/src/main/java/io/github/cjstehno/ersatz/cfg/ContentType.java
// public static final ContentType TEXT_PLAIN = new ContentType("text/plain");
// 
// Path: ersatz/src/main/java/io/github/cjstehno/ersatz/encdec/MultipartRequestContent.java
// public static MultipartRequestContent multipartRequest(final Consumer<MultipartRequestContent> config) {
//     MultipartRequestContent request = new MultipartRequestContent();
//     config.accept(request);
//     return request;
// }


import lombok.val;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import static io.github.cjstehno.ersatz.TestAssertions.verifyEqualityAndHashCode;
import static io.github.cjstehno.ersatz.cfg.ContentType.IMAGE_PNG;
import static io.github.cjstehno.ersatz.cfg.ContentType.TEXT_PLAIN;
import static io.github.cjstehno.ersatz.encdec.MultipartRequestContent.multipartRequest;
import static org.junit.jupiter.api.Assertions.assertEquals;

/**
 * Copyright (C) 2022 Christopher J. Stehno
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *         http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package io.github.cjstehno.ersatz.encdec;



class MultipartRequestContentTest {

    private static MultipartRequestContent multipartRequestContent() {
        return multipartRequest(mrc -> {
            mrc.part("alpha", "one");
            mrc.part("bravo", "text/markdown", "this _is_ *rich^ text");
            mrc.part("charlie", IMAGE_PNG, new byte[]{8, 6, 7, 5, 3, 0, 9});
            mrc.part("delta", "delta.txt", "text/markdown", "this _is_ more text");
            mrc.part("echo", "some.png", IMAGE_PNG, new byte[]{4, 2});
        });
    }

    @Test @DisplayName("consumer configuration") void consumer() {
        val content = multipartRequestContent();


// Path: ersatz/src/test/java/io/github/cjstehno/ersatz/TestAssertions.java
// static void verifyEqualityAndHashCode(final Object instanceA, final Object instanceB) {
//     assertThat(instanceA, equalTo(instanceA));
//     assertThat(instanceB, equalTo(instanceB));
//     assertThat(instanceA, equalTo(instanceB));
//     assertThat(instanceB, equalTo(instanceA));
//     assertThat(instanceA, not(equalTo(null)));
//     assertThat(instanceB, not(equalTo(null)));
//     assertThat(instanceA.hashCode(), equalTo(instanceA.hashCode()));
//     assertThat(instanceB.hashCode(), equalTo(instanceB.hashCode()));
//     assertThat(instanceA.hashCode(), equalTo(instanceB.hashCode()));
//     assertThat(instanceB.hashCode(), equalTo(instanceA.hashCode()));
// }
// 
// Path: ersatz/src/main/java/io/github/cjstehno/ersatz/cfg/ContentType.java
// public static final ContentType IMAGE_PNG = new ContentType("image/png");
// 
// Path: ersatz/src/main/java/io/github/cjstehno/ersatz/cfg/ContentType.java
// public static final ContentType TEXT_PLAIN = new ContentType("text/plain");
// 
// Path: ersatz/src/main/java/io/github/cjstehno/ersatz/encdec/MultipartRequestContent.java
// public static MultipartRequestContent multipartRequest(final Consumer<MultipartRequestContent> config) {
//     MultipartRequestContent request = new MultipartRequestContent();
//     config.accept(request);
//     return request;
// }


// Path: ersatz/src/test/java/io/github/cjstehno/ersatz/encdec/MultipartRequestContentTest.java
import lombok.val;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import static io.github.cjstehno.ersatz.TestAssertions.verifyEqualityAndHashCode;
import static io.github.cjstehno.ersatz.cfg.ContentType.IMAGE_PNG;
import static io.github.cjstehno.ersatz.cfg.ContentType.TEXT_PLAIN;
import static io.github.cjstehno.ersatz.encdec.MultipartRequestContent.multipartRequest;
import static org.junit.jupiter.api.Assertions.assertEquals;

/**
 * Copyright (C) 2022 Christopher J. Stehno
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *         http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package io.github.cjstehno.ersatz.encdec;



class MultipartRequestContentTest {

    private static MultipartRequestContent multipartRequestContent() {
        return multipartRequest(mrc -> {
            mrc.part("alpha", "one");
            mrc.part("bravo", "text/markdown", "this _is_ *rich^ text");
            mrc.part("charlie", IMAGE_PNG, new byte[]{8, 6, 7, 5, 3, 0, 9});
            mrc.part("delta", "delta.txt", "text/markdown", "this _is_ more text");
            mrc.part("echo", "some.png", IMAGE_PNG, new byte[]{4, 2});
        });
    }

    @Test @DisplayName("consumer configuration") void consumer() {
        val content = multipartRequestContent();


        assertEquals(new MultipartPart("alpha", null, TEXT_PLAIN.getValue(), null, "one"), content.getAt("alpha"));
