// 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");


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 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 MultipartPartTest {

    private MultipartPart multipartPart() {
        return new MultipartPart("file", "file.txt", "text/plain", "binary", "some file");
    }

    @Test @DisplayName("properties") void properties() {
        final var part = multipartPart();
        assertEquals("file", part.getFieldName());
        assertEquals("file.txt", part.getFileName());
        assertEquals("text/plain", part.getContentType());
        assertEquals("binary", part.getTransferEncoding());
        assertEquals("some file", part.getValue());
    }

    @Test @DisplayName("equals and hashCode")
    void equalsAndHash() {

// 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/test/java/io/github/cjstehno/ersatz/encdec/MultipartPartTest.java
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 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 MultipartPartTest {

    private MultipartPart multipartPart() {
        return new MultipartPart("file", "file.txt", "text/plain", "binary", "some file");
    }

    @Test @DisplayName("properties") void properties() {
        final var part = multipartPart();
        assertEquals("file", part.getFieldName());
        assertEquals("file.txt", part.getFileName());
        assertEquals("text/plain", part.getContentType());
        assertEquals("binary", part.getTransferEncoding());
        assertEquals("some file", part.getValue());
    }

    @Test @DisplayName("equals and hashCode")
    void equalsAndHash() {

        verifyEqualityAndHashCode(multipartPart(), multipartPart());
