diff --git a/test/http/file_test_utilities.hpp b/test/http/file_test_utilities.hpp
new file mode 100644
index 0000000..073a074
--- /dev/null
+++ b/test/http/file_test_utilities.hpp
@@ -0,0 +1,19 @@
+#pragma once
+#include <filesystem>
+#include <string>
+#include <string_view>
+
+#include <gtest/gtest.h>
+
+inline std::string makeFile(std::string_view sampleData)
+{
+    std::filesystem::path path = std::filesystem::temp_directory_path();
+    path /= "bmcweb_http_response_test_XXXXXXXXXXX";
+    std::string stringPath = path.string();
+    int fd = mkstemp(stringPath.data());
+    EXPECT_GT(fd, 0);
+    EXPECT_EQ(write(fd, sampleData.data(), sampleData.size()),
+              sampleData.size());
+    close(fd);
+    return stringPath;
+}
diff --git a/test/http/http_file_body_test.cpp b/test/http/http_file_body_test.cpp
new file mode 100644
index 0000000..4eaa93b
--- /dev/null
+++ b/test/http/http_file_body_test.cpp
@@ -0,0 +1,128 @@
+#include "file_test_utilities.hpp"
+#include "http_file_body.hpp"
+
+#include <boost/system/error_code.hpp>
+
+#include <array>
+#include <span>
+#include <string>
+
+#include <gmock/gmock.h>
+#include <gtest/gtest.h>
+
+using ::testing::ElementsAre;
+
+namespace bmcweb
+{
+namespace
+{
+
+TEST(HttpFileBodyValueType, MoveString)
+{
+    FileBody::value_type value("teststring");
+    // Move constructor
+    FileBody::value_type value2(std::move(value));
+    EXPECT_EQ(value2.encodingType, EncodingType::Raw);
+    EXPECT_EQ(value2.str(), "teststring");
+    EXPECT_EQ(value2.payloadSize(), 10);
+}
+
+TEST(HttpFileBodyValueType, MoveOperatorString)
+{
+    FileBody::value_type value;
+    value.str() = "teststring";
+    // Move constructor
+    FileBody::value_type value2 = std::move(value);
+    EXPECT_EQ(value2.encodingType, EncodingType::Raw);
+    EXPECT_EQ(value2.str(), "teststring");
+    EXPECT_EQ(value2.payloadSize(), 10);
+}
+
+TEST(HttpFileBodyValueType, copysignl)
+{
+    FileBody::value_type value;
+    value.str() = "teststring";
+    // Move constructor
+    FileBody::value_type value2(value);
+    EXPECT_EQ(value2.encodingType, EncodingType::Raw);
+    EXPECT_EQ(value2.str(), "teststring");
+    EXPECT_EQ(value2.payloadSize(), 10);
+}
+
+TEST(HttpFileBodyValueType, CopyOperatorString)
+{
+    FileBody::value_type value;
+    value.str() = "teststring";
+    // Move constructor
+    FileBody::value_type value2 = value;
+    EXPECT_EQ(value2.encodingType, EncodingType::Raw);
+    EXPECT_EQ(value2.str(), "teststring");
+    EXPECT_EQ(value2.payloadSize(), 10);
+}
+
+TEST(HttpFileBodyValueType, MoveFile)
+{
+    FileBody::value_type value(EncodingType::Base64);
+    std::string filepath = makeFile("teststring");
+    boost::system::error_code ec;
+    value.open(filepath.c_str(), boost::beast::file_mode::read, ec);
+    ASSERT_FALSE(ec);
+    // Move constructor
+    FileBody::value_type value2(std::move(value));
+    std::array<char, 11> buffer{};
+    size_t out = value2.file().read(buffer.data(), buffer.size(), ec);
+    ASSERT_FALSE(ec);
+    EXPECT_EQ(value2.encodingType, EncodingType::Base64);
+
+    EXPECT_THAT(std::span(buffer.data(), out),
+                ElementsAre('t', 'e', 's', 't', 's', 't', 'r', 'i', 'n', 'g'));
+
+    EXPECT_THAT(buffer, ElementsAre('t', 'e', 's', 't', 's', 't', 'r', 'i', 'n',
+                                    'g', '\0'));
+
+    EXPECT_EQ(value2.payloadSize(), 16);
+}
+
+TEST(HttpFileBodyValueType, MoveOperatorFile)
+{
+    FileBody::value_type value(EncodingType::Base64);
+    std::string filepath = makeFile("teststring");
+    boost::system::error_code ec;
+    value.open(filepath.c_str(), boost::beast::file_mode::read, ec);
+    ASSERT_FALSE(ec);
+    // Move constructor
+    FileBody::value_type value2 = std::move(value);
+    std::array<char, 11> buffer{};
+    size_t out = value2.file().read(buffer.data(), buffer.size(), ec);
+    ASSERT_FALSE(ec);
+    EXPECT_EQ(value2.encodingType, EncodingType::Base64);
+
+    EXPECT_THAT(std::span(buffer.data(), out),
+                ElementsAre('t', 'e', 's', 't', 's', 't', 'r', 'i', 'n', 'g'));
+    EXPECT_THAT(buffer, ElementsAre('t', 'e', 's', 't', 's', 't', 'r', 'i', 'n',
+                                    'g', '\0'));
+
+    EXPECT_EQ(value2.payloadSize(), 16);
+}
+
+TEST(HttpFileBodyValueType, SetFd)
+{
+    FileBody::value_type value(EncodingType::Base64);
+    std::string filepath = makeFile("teststring");
+
+    boost::system::error_code ec;
+    value.setFd(fileno(fopen(filepath.c_str(), "r")), ec);
+    ASSERT_FALSE(ec);
+
+    std::array<char, 4096> buffer{};
+
+    size_t out = value.file().read(buffer.data(), buffer.size(), ec);
+    ASSERT_FALSE(ec);
+
+    EXPECT_THAT(std::span(buffer.data(), out),
+                ElementsAre('t', 'e', 's', 't', 's', 't', 'r', 'i', 'n', 'g'));
+    EXPECT_EQ(value.payloadSize(), 16);
+}
+
+} // namespace
+} // namespace bmcweb
diff --git a/test/http/http_response_test.cpp b/test/http/http_response_test.cpp
index f61d6de..c5bfbdc 100644
--- a/test/http/http_response_test.cpp
+++ b/test/http/http_response_test.cpp
@@ -1,6 +1,7 @@
 #include "boost/beast/core/buffers_to_string.hpp"
 #include "boost/beast/core/flat_buffer.hpp"
 #include "boost/beast/http/serializer.hpp"
+#include "file_test_utilities.hpp"
 #include "http/http_response.hpp"
 
 #include <filesystem>
@@ -23,19 +24,6 @@
     EXPECT_EQ(res.result(), boost::beast::http::status::ok);
 }
 
-std::string makeFile(std::string_view sampleData)
-{
-    std::filesystem::path path = std::filesystem::temp_directory_path();
-    path /= "bmcweb_http_response_test_XXXXXXXXXXX";
-    std::string stringPath = path.string();
-    int fd = mkstemp(stringPath.data());
-    EXPECT_GT(fd, 0);
-    EXPECT_EQ(write(fd, sampleData.data(), sampleData.size()),
-              sampleData.size());
-    close(fd);
-    return stringPath;
-}
-
 std::string getData(boost::beast::http::response<bmcweb::FileBody>& m)
 {
     std::string ret;
@@ -139,6 +127,24 @@
     EXPECT_EQ(getData(fb), data);
 }
 
+std::string generateBigdata()
+{
+    std::string result;
+    while (result.size() < 10000)
+    {
+        result += "sample text";
+    }
+    return result;
+}
+
+TEST(HttpResponse, StringBodyWriterLarge)
+{
+    crow::Response res;
+    std::string data = generateBigdata();
+    res.write(std::string(data));
+    testFileData(res, data);
+}
+
 TEST(HttpResponse, Base64FileBodyWriter)
 {
     crow::Response res;
@@ -151,16 +157,6 @@
     std::filesystem::remove(path);
 }
 
-std::string generateBigdata()
-{
-    std::string result;
-    while (result.size() < 10000)
-    {
-        result += "sample text";
-    }
-    return result;
-}
-
 TEST(HttpResponse, Base64FileBodyWriterLarge)
 {
     crow::Response res;
