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


C# TestContext.GetJobResourceUploader方法代码示例

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


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

示例1: UploadJobResourceNoFileCreatedByJavaCallThrowsException

        public void UploadJobResourceNoFileCreatedByJavaCallThrowsException()
        {
            var testContext = new TestContext();
            var jobResourceUploader = testContext.GetJobResourceUploader(fileExistsReturnValue: false);

            // throws filenotfound exception
            jobResourceUploader.UploadJobResource(AnyDriverLocalFolderPath);
        }
开发者ID:NurimOnsemiro,项目名称:reef,代码行数:8,代码来源:LegacyJobResourceUploaderTests.cs

示例2: UploadJobResourceCreatesResourceArchive

        public void UploadJobResourceCreatesResourceArchive()
        {
            var testContext = new TestContext();
            var jobResourceUploader = testContext.GetJobResourceUploader();
            
            jobResourceUploader.UploadJobResource(AnyDriverLocalFolderPath);

            // Archive file generator recieved exactly one call with correct driver local folder path with trailing \
            testContext.ResourceArchiveFileGenerator.Received(1).CreateArchiveToUpload(AnyDriverLocalFolderPath + @"\");
        }
开发者ID:NurimOnsemiro,项目名称:reef,代码行数:10,代码来源:LegacyJobResourceUploaderTests.cs

示例3: UploadJobResourceReturnsJobResourceDetails

        public void UploadJobResourceReturnsJobResourceDetails()
        {
            var testContext = new TestContext();
            var jobResourceUploader = testContext.GetJobResourceUploader();

            var jobResource = jobResourceUploader.UploadJobResource(AnyDriverLocalFolderPath);

            Assert.AreEqual(AnyModificationTime, jobResource.LastModificationUnixTimestamp);
            Assert.AreEqual(AnyResourceSize, jobResource.ResourceSize);
            Assert.AreEqual(AnyUploadedResourceAbsoluteUri, jobResource.RemoteUploadPath);
        }
开发者ID:NurimOnsemiro,项目名称:reef,代码行数:11,代码来源:JobResourceUploaderTests.cs

示例4: UploadJobResourceMakesCorrectFileSystemCalls

        public void UploadJobResourceMakesCorrectFileSystemCalls()
        {
            var testContext = new TestContext();
            var jobResourceUploader = testContext.GetJobResourceUploader();

            jobResourceUploader.UploadJobResource(AnyDriverLocalFolderPath);

            testContext.FileSystem.Received(1).CreateUriForPath(AnyDriverResourceUploadPath);
            testContext.FileSystem.Received(1).CreateUriForPath(AnyUploadedResourcePath);
            testContext.FileSystem.Received(1)
                .CopyFromLocal(AnyLocalArchivePath, new Uri(AnyUploadedResourceAbsoluteUri));
            testContext.FileSystem.Received(1)
                .CreateDirectory(new Uri(AnyScheme + AnyHost + AnyDriverResourceUploadPath));
        }
开发者ID:NurimOnsemiro,项目名称:reef,代码行数:14,代码来源:JobResourceUploaderTests.cs

示例5: UploadJobResourceJavaLauncherCalledWithCorrectArguments

        public void UploadJobResourceJavaLauncherCalledWithCorrectArguments()
        {
            var testContext = new TestContext();
            var jobResourceUploader = testContext.GetJobResourceUploader();
            const string anyLocalArchivePath = @"Any\Local\Archive\Path.zip";
            testContext.ResourceArchiveFileGenerator.CreateArchiveToUpload(AnyDriverLocalFolderPath + @"\")
                .Returns(anyLocalArchivePath);
            testContext.JobSubmissionDirectoryProvider.GetJobSubmissionRemoteDirectory().Returns(AnyDriverResourceUploadPath);
            jobResourceUploader.UploadJobResource(AnyDriverLocalFolderPath);

            const string javaClassNameForResourceUploader = @"org.apache.reef.bridge.client.JobResourceUploader";
            Guid notUsed;

            // Clientlauncher is called with correct class name, local archive path, upload path and temp file.
            testContext.JavaClientLauncher.Received()
                .Launch(javaClassNameForResourceUploader,
                    anyLocalArchivePath,
                    AnyDriverResourceUploadPath + "/",
                    Arg.Is<string>(
                        outputFilePath =>
                            Path.GetDirectoryName(outputFilePath) + @"\" == Path.GetTempPath() 
                            && Guid.TryParse(Path.GetFileName(outputFilePath), out notUsed)));
        }
开发者ID:NurimOnsemiro,项目名称:reef,代码行数:23,代码来源:LegacyJobResourceUploaderTests.cs

示例6: UploadJobResourceCallsJobSubmissionDirProvider

        public void UploadJobResourceCallsJobSubmissionDirProvider()
        {
            var testContext = new TestContext();
            var jobResourceUploader = testContext.GetJobResourceUploader();

            jobResourceUploader.UploadJobResource(AnyDriverLocalFolderPath);

            testContext.JobSubmissionDirectoryProvider.Received(1).GetJobSubmissionRemoteDirectory();
        }
开发者ID:NurimOnsemiro,项目名称:reef,代码行数:9,代码来源:JobResourceUploaderTests.cs


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