public void CopyObjectNonMatchingETagNegativeTest()
{
var targetObjectKey = OssTestUtils.GetObjectKey(_className);
var coRequest = new CopyObjectRequest(_bucketName, _sourceObjectKey, _bucketName, targetObjectKey);
coRequest.NonmatchingETagConstraints.Add(_sourceObjectETag);
try
{
_ossClient.CopyObject(coRequest);
Assert.Fail("Copy object should not pass with NonMatchingETag set to correct value");
}
catch (OssException e)
{
Assert.AreEqual(OssErrorCode.NotModified, e.ErrorCode);
}
Assert.IsFalse(OssTestUtils.ObjectExists(_ossClient, _bucketName, targetObjectKey));
}