test: Add first unit-test to verify factory

Verify the factory does what we expect.

Change-Id: Ied4fbe45b1b46c0cc5726c9d5e437a9cb92e6182
Signed-off-by: Patrick Venture <venture@google.com>
diff --git a/test/Makefile.am b/test/Makefile.am
new file mode 100644
index 0000000..d3a971d
--- /dev/null
+++ b/test/Makefile.am
@@ -0,0 +1,19 @@
+AM_CPPFLAGS = -I$(top_srcdir)/ \
+	$(GTEST_CFLAGS) \
+	$(GMOCK_CFLAGS)
+AM_CXXFLAGS = \
+	$(GTEST_MAIN_CFLAGS)
+AM_LDFLAGS = \
+	$(GMOCK_LIBS) \
+	$(GTEST_MAIN_LIBS) \
+	$(OESDK_TESTCASE_FLAGS)
+
+# Run all 'check' test programs
+check_PROGRAMS = \
+	firmware_handler
+
+TESTS = $(check_PROGRAMS)
+
+firmware_handler_SOURCES = firmware_handler_unittest.cpp
+firmware_handler_LDADD = $(top_builddir)/firmware_handler.o
+
diff --git a/test/firmware_handler_unittest.cpp b/test/firmware_handler_unittest.cpp
new file mode 100644
index 0000000..97c28f8
--- /dev/null
+++ b/test/firmware_handler_unittest.cpp
@@ -0,0 +1,16 @@
+#include "firmware_handler.hpp"
+
+#include <memory>
+
+#include <gtest/gtest.h>
+
+namespace blobs
+{
+TEST(FirmwareHandlerTest, CreateEmptyListVerifyHasHash)
+{
+    auto handler = FirmwareBlobHandler::CreateFirmwareBlobHandler({}, 0);
+    auto result = handler->getBlobIds();
+    EXPECT_EQ(1, result.size());
+    EXPECT_STREQ(result.at(0).c_str(), FirmwareBlobHandler::hashBlobID.c_str());
+}
+} // namespace blobs