Beispiel #1
0
            public IFileSystem GetAzureFileSystem()
            {
                var conf = AzureBlockBlobFileSystemConfiguration.ConfigurationModule
                           .Set(AzureBlockBlobFileSystemConfiguration.ConnectionString, "DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;")
                           .Build();

                var injector = TangFactory.GetTang().NewInjector(conf);

                injector.BindVolatileInstance(TestCloudBlobClient);
                var fs = injector.GetInstance <AzureBlockBlobFileSystem>();

                TestCloudBlobClient.BaseUri.ReturnsForAnyArgs(FakeUri);
                TestCloudBlobClient.GetBlockBlobReference(FakeUri).ReturnsForAnyArgs(TestCloudBlockBlob);
                TestCloudBlobClient.GetContainerReference("container").ReturnsForAnyArgs(TestCloudBlobContainer);
                TestCloudBlobContainer.GetDirectoryReference("directory").ReturnsForAnyArgs(TestCloudBlobDirectory);
                TestCloudBlobDirectory.GetDirectoryReference("directory").ReturnsForAnyArgs(TestCloudBlobDirectory);
                return(fs);
            }
Beispiel #2
0
            public IFileSystem GetAzureFileSystem()
            {
                var conf = AzureBlobFileSystemConfiguration.ConfigurationModule
                           .Set(AzureBlobFileSystemConfiguration.AccountName, "accountName")
                           .Set(AzureBlobFileSystemConfiguration.AccountKey, "accountKey")
                           .Build();

                var injector = TangFactory.GetTang().NewInjector(conf);

                injector.BindVolatileInstance(TestCloudBlobClient);
                var fs = injector.GetInstance <AzureBlobFileSystem>();

                TestCloudBlobClient.BaseUri.ReturnsForAnyArgs(BaseUri);
                TestCloudBlockBlob.Open().Returns(TestOpenStream);
                TestCloudBlockBlob.Create().Returns(TestCreateStream);
                TestCloudBlockBlob.Blob.ReturnsForAnyArgs(new CloudBlockBlob(FakeUri));
                TestCloudBlobClient.GetBlockBlobReference(FakeUri).ReturnsForAnyArgs(TestCloudBlockBlob);
                TestCloudBlobClient.GetContainerReference("container").ReturnsForAnyArgs(TestCloudBlobContainer);
                TestCloudBlobContainer.GetDirectoryReference("directory").ReturnsForAnyArgs(TestCloudBlobDirectory);
                TestCloudBlobDirectory.GetDirectoryReference("directory").ReturnsForAnyArgs(TestCloudBlobDirectory);
                return(fs);
            }