public void TestGetBlobAsync() { using (ShimsContext.Create()) { connectionStrings.Add(new ConnectionStringSettings(AppSettings.SEVIS_DS2019_STORAGE_CONNECTION_STRING_KEY, "connection string")); string connectionString = settings.DS2019FileStorageConnectionString.ConnectionString; string blobName = "TestBlob"; string containerName = "ds2019"; var blobShim = new Microsoft.WindowsAzure.Storage.Blob.Fakes.ShimCloudBlockBlob { }; iBlobStorageSettings.Setup(x => x.CreateBlockBlob(It.IsAny <string>(), It.IsAny <string>(), It.IsAny <string>())) .Returns(blobShim); var shimContainer = new Microsoft.WindowsAzure.Storage.Blob.Fakes.ShimCloudBlobContainer { GetBlockBlobReferenceString = (blbnm) => { return(blobShim); } }; iBlobStorageSettings.Setup(x => x.BlobContainer("ds2019")) .Returns(shimContainer); Microsoft.WindowsAzure.Storage.Blob.Fakes.ShimCloudBlob.AllInstances.ExistsBlobRequestOptionsOperationContext = (blob, opts, contxt) => { return(true); }; var testInstance = service.GetBlob(blobName, containerName); Assert.IsNotNull(testInstance); var testAsyncInstance = service.GetBlobAsync(blobName, containerName); Assert.IsNotNull(testAsyncInstance); } }