#include <string>
#include "base/check.h"
#include "base/functional/callback.h"
#include "base/run_loop.h"
#include "base/strings/stringprintf.h"
#include "base/test/scoped_feature_list.h"
#include "base/test/simple_test_clock.h"
#include "base/test/task_environment.h"
#include "components/commerce/core/parcel/parcels_storage.h"
#include "components/commerce/core/proto/parcel.pb.h"
#include "components/commerce/core/proto/parcel_tracking_db_content.pb.h"
#include "components/session_proto_db/session_proto_storage.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
_;
InSequence;
namespace {
const commerce::ParcelIdentifier::Carrier kCarrier1 = …;
const std::string kTrackingId1 = …;
const std::string kTrackingId2 = …;
const commerce::ParcelStatus::ParcelState kDefaultState = …;
std::string GetStorageKey(commerce::ParcelIdentifier::Carrier carrier,
const std::string& tracking_id) { … }
commerce::ParcelStatus CreateParcelStatus(
commerce::ParcelIdentifier::Carrier carrier,
const std::string& tracking_id,
commerce::ParcelStatus::ParcelState state) { … }
parcel_tracking_db::ParcelTrackingContent CreateParcelTrackingContent(
commerce::ParcelIdentifier::Carrier carrier,
const std::string& tracking_id,
commerce::ParcelStatus::ParcelState state) { … }
std::vector<
SessionProtoStorage<parcel_tracking_db::ParcelTrackingContent>::KeyAndValue>
MockDbLoadResponse() { … }
void DoNothing(bool success) { … }
class MockProtoStorage
: public SessionProtoStorage<parcel_tracking_db::ParcelTrackingContent> { … };
}
namespace commerce {
class ParcelsStorageTest : public testing::Test { … };
TEST_F(ParcelsStorageTest, TestGetAllParcelTrackingContents) { … }
TEST_F(ParcelsStorageTest, TestDeleteAllParcelStatus) { … }
TEST_F(ParcelsStorageTest, TestDeleteParcelStatus) { … }
TEST_F(ParcelsStorageTest, TestDeleteMultipleParcelsStatus) { … }
TEST_F(ParcelsStorageTest, TestUpdateParcelStatus) { … }
TEST_F(ParcelsStorageTest, TestModifyOldDoneParcels) { … }
}