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