本文整理汇总了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();
}