示例#1
0
        public async Task GetManagedDiskPageRangesDiffAsync_AccessConditions()
        {
            var snapshot2Client = InstrumentClient(new PageBlobClient(snapshot2SASUri, GetOptions()));

            foreach (var parameters in Reduced_AccessConditions_Data)
            {
                parameters.Match = await SetupBlobMatchCondition(snapshot2Client, parameters.Match);

                PageBlobRequestConditions accessConditions = PageBlobClientTests.BuildAccessConditions(
                    parameters: parameters,
                    lease: false);

                // Act
                Response <PageRangesInfo> response = await snapshot2Client.GetManagedDiskPageRangesDiffAsync(
                    range : new HttpRange(0, Constants.KB),
                    previousSnapshotUri : snapshot1SASUri,
                    conditions : accessConditions);

                // Assert
                Assert.IsNotNull(response.Value.PageRanges);
            }
        }
示例#2
0
        public async Task GetManagedDiskPageRangesDiffAsync_AccessConditionsFail()
        {
            var snapshot2Client = InstrumentClient(new PageBlobClient(snapshot2SASUri, GetOptions()));

            foreach (var parameters in Reduced_AccessConditions_Fail_Data)
            {
                parameters.NoneMatch = await SetupBlobMatchCondition(snapshot2Client, parameters.NoneMatch);

                PageBlobRequestConditions accessConditions = PageBlobClientTests.BuildAccessConditions(
                    parameters: parameters,
                    lease: false);

                // Act
                await TestHelper.CatchAsync <Exception>(
                    async() =>
                {
                    var _ = (await snapshot2Client.GetManagedDiskPageRangesDiffAsync(
                                 range: new HttpRange(0, Constants.KB),
                                 previousSnapshotUri: snapshot1SASUri,
                                 conditions: accessConditions)).Value;
                });
            }
        }