#include "retriever.h"
#include <libaddressinput/callback.h>
#include <libaddressinput/null_storage.h>
#include <libaddressinput/storage.h>
#include <cstddef>
#include <memory>
#include <string>
#include <gtest/gtest.h>
#include "mock_source.h"
#include "testdata_source.h"
#define CHECKSUM …
#define DATA …
#define OLD_TIMESTAMP …
namespace {
BuildCallback;
MockSource;
NullStorage;
Retriever;
Storage;
TestdataSource;
const char kKey[] = …;
const char kEmptyData[] = …;
const char kStaleData[] = …;
const char kStaleWrappedData[] = …;
class RetrieverTest : public testing::Test { … };
TEST_F(RetrieverTest, RetrieveData) { … }
TEST_F(RetrieverTest, ReadDataFromStorage) { … }
TEST_F(RetrieverTest, MissingKeyReturnsEmptyData) { … }
TEST_F(RetrieverTest, FaultySource) { … }
class StaleStorage : public Storage { … };
TEST_F(RetrieverTest, UseStaleDataWhenSourceFails) { … }
TEST_F(RetrieverTest, DoNotUseStaleDataWhenSourceSucceeds) { … }
}