当前位置: 首页>>代码示例>>C#>>正文


C# TestContext.VerifyUriAndContentAsync方法代码示例

本文整理汇总了C#中TestContext.VerifyUriAndContentAsync方法的典型用法代码示例。如果您正苦于以下问题:C# TestContext.VerifyUriAndContentAsync方法的具体用法?C# TestContext.VerifyUriAndContentAsync怎么用?C# TestContext.VerifyUriAndContentAsync使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TestContext的用法示例。


在下文中一共展示了TestContext.VerifyUriAndContentAsync方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Client_UploadsJustLatestToStorage

        public async Task Client_UploadsJustLatestToStorage()
        {
            // Arrange
            using (var tc = new TestContext())
            {
                tc.UploadRequest.UploadDirect = false;

                // Act
                var uploadResult = await tc.Target.UploadAsync(tc.UploadRequest);

                // Assert
                Assert.NotNull(uploadResult);
                Assert.Null(uploadResult.DirectUri);
                Assert.Null(uploadResult.DirectETag);
                await tc.VerifyUriAndContentAsync(uploadResult.LatestUri, "testpath/latest.txt");
                Assert.NotNull(uploadResult.LatestETag);
            }
        }
开发者ID:joelverhagen,项目名称:ToStorage,代码行数:18,代码来源:ClientTests.cs

示例2: Client_UploadsJustDirectTimestampToStorage

        public async Task Client_UploadsJustDirectTimestampToStorage()
        {
            // Arrange
            using (var tc = new TestContext())
            {
                tc.UploadRequest.Type = UploadRequestType.Timestamp;
                tc.UploadRequest.UploadLatest = false;

                // Act
                var uploadResult = await tc.Target.UploadAsync(tc.UploadRequest);

                // Assert
                Assert.NotNull(uploadResult);
                await tc.VerifyUriAndContentAsync(uploadResult.DirectUri, "testpath/2015.01.02.03.04.05.0060000.txt");
                Assert.NotNull(uploadResult.DirectETag);
                Assert.Null(uploadResult.LatestUri);
                Assert.Null(uploadResult.LatestETag);
            }
        }
开发者ID:joelverhagen,项目名称:ToStorage,代码行数:19,代码来源:ClientTests.cs

示例3: Client_AllowsNextNumberToBeChangedWithRequest

        public async Task Client_AllowsNextNumberToBeChangedWithRequest()
        {
            // Arrange
            using (var tc = new TestContext())
            {
                tc.UploadRequest.Type = UploadRequestType.Number;
                tc.UploadRequest.ContentType = "application/json";
                tc.UploadRequest.Stream = new MemoryStream(Encoding.UTF8.GetBytes("[1, 2]"));
                var setupResult = await tc.Target.UploadAsync(tc.UploadRequest);

                tc.UploadRequest.LatestNumberETag = setupResult.LatestNumberETag;
                tc.UploadRequest.LatestNumber = 5;
                tc.UploadRequest.ETag = setupResult.LatestETag;
                tc.UploadRequest.ContentType = "text/plain";
                tc.UploadRequest.Stream = new MemoryStream(Encoding.UTF8.GetBytes(tc.Content));

                // Act
                var uploadResult = await tc.Target.UploadAsync(tc.UploadRequest);

                // Assert
                Assert.NotNull(uploadResult);
                await tc.VerifyUriAndContentAsync(setupResult.DirectUri, "testpath/1.txt", "[1, 2]");
                await tc.VerifyUriAndContentAsync(uploadResult.DirectUri, "testpath/5.txt");
                Assert.NotNull(uploadResult.DirectETag);
                await tc.VerifyUriAndContentAsync(uploadResult.LatestUri, "testpath/latest.txt");
                Assert.NotNull(uploadResult.LatestETag);
                Assert.NotNull(uploadResult.LatestNumberETag);
                Assert.Equal(5, uploadResult.LatestNumber);
            }
        }
开发者ID:joelverhagen,项目名称:ToStorage,代码行数:30,代码来源:ClientTests.cs

示例4: Client_UploadsDirectNumberToStorage

        public async Task Client_UploadsDirectNumberToStorage()
        {
            // Arrange
            using (var tc = new TestContext())
            {
                tc.UploadRequest.Type = UploadRequestType.Number;
                tc.UploadRequest.UploadLatest = false;

                // Act
                var uploadResult = await tc.Target.UploadAsync(tc.UploadRequest);

                // Assert
                Assert.NotNull(uploadResult);
                await tc.VerifyUriAndContentAsync(uploadResult.DirectUri, "testpath/1.txt");
                Assert.NotNull(uploadResult.DirectETag);
                Assert.Null(uploadResult.LatestUri);
                Assert.Null(uploadResult.LatestETag);
                Assert.NotNull(uploadResult.LatestNumberETag);
                Assert.Equal(1, uploadResult.LatestNumber);
            }
        }
开发者ID:joelverhagen,项目名称:ToStorage,代码行数:21,代码来源:ClientTests.cs

示例5: Client_UploadOverwritesExistingTimestampBlobs

        public async Task Client_UploadOverwritesExistingTimestampBlobs()
        {
            // Arrange
            using (var tc = new TestContext())
            {
                tc.UploadRequest.Type = UploadRequestType.Timestamp;
                tc.UploadRequest.ContentType = "application/json";
                tc.UploadRequest.Stream = new MemoryStream(Encoding.UTF8.GetBytes("[1, 2]"));
                var setupResult = await tc.Target.UploadAsync(tc.UploadRequest);

                tc.UploadRequest.ContentType = "text/plain";
                tc.UploadRequest.Stream = new MemoryStream(Encoding.UTF8.GetBytes(tc.Content));
                tc.UploadRequest.ETag = setupResult.LatestETag;

                tc.UtcNow = tc.UtcNow.AddMinutes(1);

                // Act
                var uploadResult = await tc.Target.UploadAsync(tc.UploadRequest);

                // Assert
                Assert.NotNull(uploadResult);
                await tc.VerifyUriAndContentAsync(setupResult.DirectUri, "testpath/2015.01.02.03.04.05.0060000.txt", "[1, 2]");
                await tc.VerifyUriAndContentAsync(uploadResult.DirectUri, "testpath/2015.01.02.03.05.05.0060000.txt");
                Assert.NotNull(uploadResult.DirectETag);
                await tc.VerifyUriAndContentAsync(uploadResult.LatestUri, "testpath/latest.txt");
                Assert.NotNull(uploadResult.LatestETag);
            }
        }
开发者ID:joelverhagen,项目名称:ToStorage,代码行数:28,代码来源:ClientTests.cs


注:本文中的TestContext.VerifyUriAndContentAsync方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。