question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

CloudBlobDirectory does not have any public constructor

See original GitHub issue

The CloudBlobDirectory class does not have any public constructor which means that we can’t mock this class for unit testing purposes. For instance, the following line of code:

var mockBlobDirectory = new Mock<CloudBlobDirectory>(MockBehavior.Strict);

causes the following exception:

System.NotSupportedException : Parent does not have a default constructor. The default constructor must be explicitly defined.

Can you please consider adding a public constructor?

Edit: I’m using Microsoft.WindowsAzure.Storage, Version=9.0.0.0.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:5
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

0reactions
gonzalolorietocommented, May 7, 2019

No public ctor AFAIK

Read more comments on GitHub >

github_iconTop Results From Across the Web

CloudBlobDirectory Constructor - Storage
Public constructor for mock unit testing.
Read more >
Mock CloudBlobClient with AutoFac and AutoMock
See this CloudBlobContainer. This type contains three constructors. And constructor is required for create instance of type. Try to type in your ...
Read more >
CloudBlobDirectory Class (Microsoft.Azure.Storage.Blob)
Public constructor for mock unit testing. Properties. Container. Gets the container for the virtual directory. Parent.
Read more >
CloudBlobDirectory (Microsoft Azure Libraries for Java)
Represents a virtual directory of blobs, designated by a delimiter character. Containers, which are encapsulated as CloudBlobContainer objects, ...
Read more >
[Solved]-ListBlobs not available in cloudblobdirectory class?-C#
What's the point to have public method in class but not in interface? Form is not available and doesn't update while a loop...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found