本文整理匯總了C#中Microsoft.VisualStudio.TestTools.UnitTesting.TestContext.GetAzureFileSystem方法的典型用法代碼示例。如果您正苦於以下問題:C# TestContext.GetAzureFileSystem方法的具體用法?C# TestContext.GetAzureFileSystem怎麽用?C# TestContext.GetAzureFileSystem使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Microsoft.VisualStudio.TestTools.UnitTesting.TestContext
的用法示例。
在下文中一共展示了TestContext.GetAzureFileSystem方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: TestCreateDirectory
public void TestCreateDirectory()
{
var testContext = new TestContext();
testContext.GetAzureFileSystem().CreateDirectory(FakeUri);
testContext.TestCloudBlobClient.DidNotReceiveWithAnyArgs();
}
示例2: TestCopyToLocal
public void TestCopyToLocal()
{
var testContext = new TestContext();
testContext.GetAzureFileSystem().CopyToLocal(FakeUri, "local");
testContext.TestCloudBlockBlob.Received(1).DownloadToFile("local", FileMode.CreateNew);
}
示例3: TestCopyFromLocal
public void TestCopyFromLocal()
{
var testContext = new TestContext();
testContext.GetAzureFileSystem().CopyFromLocal("local", FakeUri);
testContext.TestCloudBlockBlob.Received(1).UploadFromFile("local", FileMode.Open);
}
示例4: TestExists
public void TestExists()
{
var testContext = new TestContext();
testContext.GetAzureFileSystem().Exists(FakeUri);
testContext.TestCloudBlockBlob.Received(1).Exists();
}
示例5: TestDelete
public void TestDelete()
{
var testContext = new TestContext();
testContext.GetAzureFileSystem().Delete(new Uri(FakeUri, "container/file"));
testContext.TestCloudBlockBlob.Received(1).Delete();
}
示例6: TestCreateUriForPath
public void TestCreateUriForPath()
{
var testContext = new TestContext();
const string dirStructure = "container/directory";
Assert.AreEqual(new Uri(FakeUri, dirStructure), testContext.GetAzureFileSystem().CreateUriForPath(dirStructure));
}
示例7: TestDeleteDirectoryRecursive
public void TestDeleteDirectoryRecursive()
{
var testContext = new TestContext();
testContext.TestCloudBlobDirectory.ListBlobs(true).ReturnsForAnyArgs(Enumerable.Repeat(testContext.TestCloudBlob, 5));
testContext.GetAzureFileSystem().DeleteDirectory(new Uri("http://test.com/container/directory/directory"));
testContext.TestCloudBlobClient.Received(1).GetContainerReference("container");
testContext.TestCloudBlobContainer.Received(1).GetDirectoryReference("directory");
testContext.TestCloudBlobDirectory.Received(1).GetDirectoryReference("directory");
testContext.TestCloudBlobDirectory.Received(1).ListBlobs(true);
testContext.TestCloudBlob.Received(5).DeleteIfExists();
}
示例8: TestDeleteDirectoryAtContainer
public void TestDeleteDirectoryAtContainer()
{
var testContext = new TestContext();
testContext.GetAzureFileSystem().DeleteDirectory(new Uri("http://test.com/test"));
testContext.TestCloudBlobClient.Received(1).GetContainerReference("test");
testContext.TestCloudBlobContainer.Received(1).DeleteIfExists();
}