CloudBlobDirectory does not have any public constructor
See original GitHub issueThe 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:
- Created 6 years ago
- Reactions:5
- Comments:8 (2 by maintainers)
Top Results From Across the Web
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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Fixed in version 10.0.3
Commit: https://github.com/Azure/azure-storage-net/commit/550427e7090ab656f4a8279e7cdd85fba6c6cc98
No public ctor AFAIK