本文整理匯總了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);
}
示例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 + @"\");
}
示例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);
}
示例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));
}
示例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)));
}
示例6: UploadJobResourceCallsJobSubmissionDirProvider
public void UploadJobResourceCallsJobSubmissionDirProvider()
{
var testContext = new TestContext();
var jobResourceUploader = testContext.GetJobResourceUploader();
jobResourceUploader.UploadJobResource(AnyDriverLocalFolderPath);
testContext.JobSubmissionDirectoryProvider.Received(1).GetJobSubmissionRemoteDirectory();
}