Split RequestConditions into MatchCondtions and ModifiedConditions (#1644)
* Split the inheritance on the RequestConditions Rename RequestConditions to ModifiedConditions
This commit is contained in:
parent
9edae4f792
commit
fcd64f7bd2
@ -2,6 +2,9 @@
|
||||
|
||||
## 1.0.0-beta.7 (Unreleased)
|
||||
|
||||
### Breaking Changes
|
||||
|
||||
- Split `Azure::Core::RequestConditions` into `Azure::Core::MatchConditions` and `Auzre::Core::ModifiedConditions`.
|
||||
|
||||
## 1.0.0-beta.6 (2021-02-09)
|
||||
|
||||
|
||||
@ -65,11 +65,11 @@ set(
|
||||
inc/azure/core/etag.hpp
|
||||
inc/azure/core/exception.hpp
|
||||
inc/azure/core/match_conditions.hpp
|
||||
inc/azure/core/modified_conditions.hpp
|
||||
inc/azure/core/nullable.hpp
|
||||
inc/azure/core/operation.hpp
|
||||
inc/azure/core/operation_status.hpp
|
||||
inc/azure/core/platform.hpp
|
||||
inc/azure/core/request_conditions.hpp
|
||||
inc/azure/core/response.hpp
|
||||
inc/azure/core/uuid.hpp
|
||||
inc/azure/core/version.hpp
|
||||
|
||||
@ -19,11 +19,11 @@
|
||||
#include "azure/core/etag.hpp"
|
||||
#include "azure/core/exception.hpp"
|
||||
#include "azure/core/match_conditions.hpp"
|
||||
#include "azure/core/modified_conditions.hpp"
|
||||
#include "azure/core/nullable.hpp"
|
||||
#include "azure/core/operation.hpp"
|
||||
#include "azure/core/operation_status.hpp"
|
||||
#include "azure/core/platform.hpp"
|
||||
#include "azure/core/request_conditions.hpp"
|
||||
#include "azure/core/response.hpp"
|
||||
#include "azure/core/uuid.hpp"
|
||||
#include "azure/core/version.hpp"
|
||||
|
||||
@ -3,14 +3,12 @@
|
||||
|
||||
/**
|
||||
* @file
|
||||
* @brief Define RequestConditions
|
||||
* @brief Define ModifiedConditions
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "azure/core/datetime.hpp"
|
||||
#include "azure/core/etag.hpp"
|
||||
#include "azure/core/match_conditions.hpp"
|
||||
|
||||
#include <string>
|
||||
|
||||
@ -19,7 +17,7 @@ namespace Azure { namespace Core {
|
||||
/**
|
||||
* @brief Specifies HTTP options for conditional requests based on modification time.
|
||||
*/
|
||||
struct RequestConditions : MatchConditions
|
||||
struct ModifiedConditions
|
||||
{
|
||||
/**
|
||||
* @brief Optionally limit requests to resources that have only been modified since this point
|
||||
@ -42,12 +42,12 @@ add_executable (
|
||||
main.cpp
|
||||
match_conditions.cpp
|
||||
md5.cpp
|
||||
modified_conditions.cpp
|
||||
nullable.cpp
|
||||
operation.cpp
|
||||
operation_status.cpp
|
||||
pipeline.cpp
|
||||
policy.cpp
|
||||
request_conditions.cpp
|
||||
simplified_header.cpp
|
||||
string.cpp
|
||||
telemetry_policy.cpp
|
||||
|
||||
@ -2,27 +2,21 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
#include <azure/core/datetime.hpp>
|
||||
#include <azure/core/etag.hpp>
|
||||
#include <azure/core/request_conditions.hpp>
|
||||
#include <azure/core/modified_conditions.hpp>
|
||||
#include <gtest/gtest.h>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
using namespace Azure::Core;
|
||||
|
||||
TEST(RequestConditions, Basic)
|
||||
TEST(ModifiedConditions, Basic)
|
||||
{
|
||||
RequestConditions conditions;
|
||||
conditions.IfMatch = ETag("IfMatch");
|
||||
conditions.IfNoneMatch = ETag("IfNoneMatch");
|
||||
ModifiedConditions conditions;
|
||||
conditions.IfModifiedSince
|
||||
= DateTime::Parse("2013-11-19T14:30:59.1234567Z", DateTime::DateFormat::Rfc3339);
|
||||
conditions.IfUnmodifiedSince
|
||||
= DateTime::Parse("2013-11-19T14:30:59.1234567Z", DateTime::DateFormat::Rfc3339);
|
||||
|
||||
EXPECT_EQ(conditions.IfMatch.ToString(), "IfMatch");
|
||||
EXPECT_EQ(conditions.IfNoneMatch.ToString(), "IfNoneMatch");
|
||||
|
||||
EXPECT_EQ(
|
||||
conditions.IfModifiedSince.GetString(DateTime::DateFormat::Rfc3339),
|
||||
"2013-11-19T14:30:59.1234567Z");
|
||||
@ -27,9 +27,9 @@ TEST(SimplifiedHeader, core)
|
||||
EXPECT_NO_THROW(Azure::Core::Http::RawResponse r(
|
||||
1, 1, Azure::Core::Http::HttpStatusCode::Accepted, "phrase"));
|
||||
EXPECT_NO_THROW(Azure::Core::MatchConditions mc);
|
||||
EXPECT_NO_THROW(Azure::Core::ModifiedConditions mc);
|
||||
EXPECT_NO_THROW(Azure::Core::Nullable<int> n);
|
||||
EXPECT_NO_THROW(Azure::Core::Uuid::CreateUuid());
|
||||
EXPECT_NO_THROW(Azure::Core::RequestConditions rc);
|
||||
EXPECT_NO_THROW(Azure::Core::RequestFailedException("foo"));
|
||||
EXPECT_NO_THROW(Azure::Core::OperationStatus("foo"));
|
||||
EXPECT_NO_THROW(Azure::Core::Details::Version::VersionString());
|
||||
|
||||
Loading…
Reference in New Issue
Block a user