Есть следущий код:
public class UploadBase
{
protected string userId;
protected string containerName;
protected int maxLengthFile;
protected CloudBlobContainer container;
protected static Logger logger = LogManager.GetLogger("UploadFile");
private static string cacheControl = "public, max-age=7776000";
public UploadBase(string containerName) : this(string.Empty, containerName)
{
maxLengthFile = 21504;
}
public UploadBase(string userId, string containerName)
{
if (string.IsNullOrEmpty(containerName))
new ArgumentNullException(containerName);
this.userId = userId;
this.containerName = containerName;
// Receiving Account storage
CloudStorageAccount storageAccount = CloudStorageAccount.Parse(ConfigurationManager.AppSettings["StorageConnectionString"].ToString());
// Create Blob client
CloudBlobClient blobClient = storageAccount.CreateCloudBlobClient();
// To get conteiner reference
container = blobClient.GetContainerReference(this.containerName);
if (!container.Exists())
{
container.CreateIfNotExists();
container.SetPermissions(new BlobContainerPermissions { PublicAccess = BlobContainerPublicAccessType.Blob });
}
}
без мока кидает ерору про NullReferenceException на эту строку:
CloudStorageAccount storageAccount = CloudStorageAccount.Parse(ConfigurationManager.AppSettings["StorageConnectionString"].ToString());
подскажите как можно это обойти