當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。