#include "http_utility.hpp"

#include <array>

#include <gtest/gtest.h>

namespace http_helpers
{
namespace
{

TEST(isContentTypeAllowed, PositiveTest)
{
    EXPECT_TRUE(isContentTypeAllowed("*/*", ContentType::HTML, true));
    EXPECT_TRUE(isContentTypeAllowed("application/octet-stream",
                                     ContentType::OctetStream, false));
    EXPECT_TRUE(isContentTypeAllowed("text/html", ContentType::HTML, false));
    EXPECT_TRUE(
        isContentTypeAllowed("application/json", ContentType::JSON, false));
    EXPECT_TRUE(
        isContentTypeAllowed("application/cbor", ContentType::CBOR, false));
    EXPECT_TRUE(isContentTypeAllowed("application/json, text/html",
                                     ContentType::HTML, false));
}

TEST(isContentTypeAllowed, NegativeTest)
{
    EXPECT_FALSE(isContentTypeAllowed("application/octet-stream",
                                      ContentType::HTML, false));
    EXPECT_FALSE(
        isContentTypeAllowed("application/html", ContentType::JSON, false));
    EXPECT_FALSE(
        isContentTypeAllowed("application/json", ContentType::CBOR, false));
    EXPECT_FALSE(
        isContentTypeAllowed("application/cbor", ContentType::HTML, false));
    EXPECT_FALSE(isContentTypeAllowed("application/json, text/html",
                                      ContentType::OctetStream, false));
}

TEST(isContentTypeAllowed, ContainsAnyMimeTypeReturnsTrue)
{
    EXPECT_TRUE(
        isContentTypeAllowed("text/html, */*", ContentType::OctetStream, true));
}

TEST(isContentTypeAllowed, ContainsQFactorWeightingReturnsTrue)
{
    EXPECT_TRUE(isContentTypeAllowed("text/html, */*;q=0.8",
                                     ContentType::OctetStream, true));
}

TEST(getPreferredContentType, PositiveTest)
{
    std::array<ContentType, 1> contentType{ContentType::HTML};
    EXPECT_EQ(
        getPreferredContentType("text/html, application/json", contentType),
        ContentType::HTML);

    std::array<ContentType, 2> htmlJson{ContentType::HTML, ContentType::JSON};
    EXPECT_EQ(getPreferredContentType("text/html, application/json", htmlJson),
              ContentType::HTML);

    // String the chrome gives
    EXPECT_EQ(getPreferredContentType(
                  "text/html,"
                  "application/xhtml+xml,"
                  "application/xml;q=0.9,"
                  "image/avif,"
                  "image/webp,"
                  "image/apng,*/*;q=0.8,"
                  "application/signed-exchange;v=b3;q=0.7",
                  htmlJson),
              ContentType::HTML);

    std::array<ContentType, 2> jsonHtml{ContentType::JSON, ContentType::HTML};
    EXPECT_EQ(getPreferredContentType("text/html, application/json", jsonHtml),
              ContentType::HTML);

    std::array<ContentType, 2> cborJson{ContentType::CBOR, ContentType::JSON};
    EXPECT_EQ(getPreferredContentType("application/cbor, application::json",
                                      cborJson),
              ContentType::CBOR);

    EXPECT_EQ(getPreferredContentType("application/json", cborJson),
              ContentType::JSON);
    EXPECT_EQ(getPreferredContentType("*/*", cborJson), ContentType::ANY);

    // Application types with odd characters
    EXPECT_EQ(getPreferredContentType(
                  "application/prs.nprend, application/json", cborJson),
              ContentType::JSON);

    EXPECT_EQ(getPreferredContentType("application/rdf+xml, application/json",
                                      cborJson),
              ContentType::JSON);

    // Q values are ignored, but should parse
    EXPECT_EQ(getPreferredContentType(
                  "application/rdf+xml;q=0.9, application/json", cborJson),
              ContentType::JSON);
    EXPECT_EQ(getPreferredContentType(
                  "application/rdf+xml;q=1, application/json", cborJson),
              ContentType::JSON);
    EXPECT_EQ(getPreferredContentType("application/json;q=0.9", cborJson),
              ContentType::JSON);
    EXPECT_EQ(getPreferredContentType("application/json;q=1", cborJson),
              ContentType::JSON);
}

TEST(getPreferredContentType, NegativeTest)
{
    std::array<ContentType, 1> contentType{ContentType::CBOR};
    EXPECT_EQ(
        getPreferredContentType("text/html, application/json", contentType),
        ContentType::NoMatch);
}

TEST(getPreferredEncoding, PositiveTest)
{
    std::array<Encoding, 1> encodingsGzip{Encoding::GZIP};
    EXPECT_EQ(getPreferredEncoding("gzip", encodingsGzip), Encoding::GZIP);

    std::array<Encoding, 2> encodingsGzipZstd{Encoding::GZIP, Encoding::ZSTD};
    EXPECT_EQ(getPreferredEncoding("gzip", encodingsGzipZstd), Encoding::GZIP);
    EXPECT_EQ(getPreferredEncoding("zstd", encodingsGzipZstd), Encoding::ZSTD);

    EXPECT_EQ(getPreferredEncoding("*", encodingsGzipZstd), Encoding::GZIP);

    EXPECT_EQ(getPreferredEncoding("zstd, gzip;q=1.0", encodingsGzipZstd),
              Encoding::ZSTD);
}

TEST(getPreferredEncoding, NegativeTest)
{
    std::array<Encoding, 2> contentType{Encoding::GZIP,
                                        Encoding::UnencodedBytes};
    EXPECT_EQ(getPreferredEncoding("noexist", contentType),
              Encoding::UnencodedBytes);

    std::array<Encoding, 1> contentType2{Encoding::GZIP};
    EXPECT_EQ(getPreferredEncoding("zstd", contentType2), Encoding::NoMatch);
}

} // namespace
} // namespace http_helpers
