public void GetBlobSasUrl_CloudBlobName_SasUrlReturned() { string blobName = NewRandomString(); string sharedAccessKey = NewRandomString(); string uri = NewRandomUrl(); _blobContainerRepository.Setup(_ => _.GetBlockBlobReference(blobName, It.IsAny <string>())) .Returns(_cloudBlob.Object); _cloudBlob.Setup(_ => _.GetSharedAccessSignature(It.IsAny <SharedAccessBlobPolicy>())) .Returns(sharedAccessKey); _cloudBlob.Setup(_ => _.Uri).Returns(new Uri(uri)); string sasUrl = _blobClient.GetBlobSasUrl(blobName, new DateTimeOffset(), new SharedAccessBlobPermissions()); sasUrl.Should() .Be($"{uri}{sharedAccessKey}"); }