I am working on nUnit tests for .NET CORE 3.1 Azure function with Azure Storage. I need to mock Azure Storage and need help on that!
I get collection of Azure Storage Files Microsoft.WindowsAzure.Storage.File.CloudFile
in object fileList
and then I am looping through it. Then I am calling FetchAttributesAsync()
How can I mock FetchAttributesAsync
, SetMetadataAsync
& ContentMD5
if (fileList.Any())
{
foreach (var foundFile in fileList)
{
await foundFile .FetchAttributesAsync();
foundFile .Metadata.Add("Discovered", "true");
await discoveredFile.SetMetadataAsync();
var md5Hash = foundFile .Properties.ContentMD5;
}