-
-
Notifications
You must be signed in to change notification settings - Fork 121
[Bug]: Mock.Of<BlobClient> fails with #5310 #5326
Copy link
Copy link
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Description
#5310 add support for classes like Azure SDK concrete clients
but I'm still encountering issues on
var blobClientMock = Mock.Of<BlobClient>(MockBehavior.Strict);
Expected Behavior
Id expect it to compile
Actual Behavior
My\runfile\obj\debug\TUnit.Mocks.SourceGenerator\TUnit.Mocks.SourceGenerator.MockGenerator\Azure_Storage_Blobs_BlobClient_MockImpl.g.cs(396,80): error CS0506: 'Azure_Storage_Blobs_BlobClient_MockImpl.WithSnapshot(string)': cannot override inherited member 'BlobClient.WithSnapshot(string)' because it is not marked virtual, abstract, or override
My\runfile\obj\debug\TUnit.Mocks.SourceGenerator\TUnit.Mocks.SourceGenerator.MockGenerator\Azure_Storage_Blobs_BlobClient_MockImpl.g.cs(414,80): error CS0506: 'Azure_Storage_Blobs_BlobClient_MockImpl.WithVersion(string)': cannot override inherited member 'BlobClient.WithVersion(string)' because it is not marked virtual, abstract, or override
My\runfile\obj\debug\TUnit.Mocks.SourceGenerator\TUnit.Mocks.SourceGenerator.MockGenerator\Azure_Storage_Blobs_BlobClient_MockImpl.g.cs(423,80): error CS0506: 'Azure_Storage_Blobs_BlobClient_MockImpl.WithCustomerProvidedKey(CustomerProvidedKey?)': cannot override inherited member 'BlobClient.WithCustomerProvidedKey(CustomerProvidedKey?)' because it is not marked virtual, abstract, or override
My\runfile\obj\debug\TUnit.Mocks.SourceGenerator\TUnit.Mocks.SourceGenerator.MockGenerator\Azure_Storage_Blobs_BlobClient_MockImpl.g.cs(432,80): error CS0506: 'Azure_Storage_Blobs_BlobClient_MockImpl.WithEncryptionScope(string)': cannot override inherited member 'BlobClient.WithEncryptionScope(string)' because it is not marked virtual, abstract, or override
My\runfile\obj\debug\TUnit.Mocks.SourceGenerator\TUnit.Mocks.SourceGenerator.MockGenerator\Azure_Storage_Blobs_BlobClient_MockMembers.g.cs(5485,83): error CS0111: Type 'Azure_Storage_Blobs_BlobClient_MockMemberExtensions' already defines a member called 'GenerateSasUri' with the same parameter types
My\runfile\obj\debug\TUnit.Mocks.SourceGenerator\TUnit.Mocks.SourceGenerator.MockGenerator\Azure_Storage_Blobs_BlobClient_MockMembers.g.cs(5491,83): error CS0111: Type 'Azure_Storage_Blobs_BlobClient_MockMemberExtensions' already defines a member called 'GenerateSasUri' with the same parameter types
My\runfile\obj\debug\TUnit.Mocks.SourceGenerator\TUnit.Mocks.SourceGenerator.MockGenerator\Azure_Storage_Blobs_BlobClient_MockMembers.g.cs(5498,83): error CS0111: Type 'Azure_Storage_Blobs_BlobClient_MockMemberExtensions' already defines a member called 'GenerateSasUri' with the same parameter types
My\runfile\obj\debug\TUnit.Mocks.SourceGenerator\TUnit.Mocks.SourceGenerator.MockGenerator\Azure_Storage_Blobs_BlobClient_MockMembers.g.cs(5505,83): error CS0111: Type 'Azure_Storage_Blobs_BlobClient_MockMemberExtensions' already defines a member called 'GenerateSasUri' with the same parameter types
My\runfile\obj\debug\TUnit.Mocks.SourceGenerator\TUnit.Mocks.SourceGenerator.MockGenerator\Azure_Storage_Blobs_BlobClient_MockMembers.g.cs(5526,83): error CS0111: Type 'Azure_Storage_Blobs_BlobClient_MockMemberExtensions' already defines a member called 'GenerateSasUri' with the same parameter types
My\runfile\obj\debug\TUnit.Mocks.SourceGenerator\TUnit.Mocks.SourceGenerator.MockGenerator\Azure_Storage_Blobs_BlobClient_MockMembers.g.cs(5532,83): error CS0111: Type 'Azure_Storage_Blobs_BlobClient_MockMemberExtensions' already defines a member called 'GenerateSasUri' with the same parameter types
My\runfile\obj\debug\TUnit.Mocks.SourceGenerator\TUnit.Mocks.SourceGenerator.MockGenerator\Azure_Storage_Blobs_BlobClient_MockMembers.g.cs(5599,97): error CS0111: Type 'Azure_Storage_Blobs_BlobClient_MockMemberExtensions' already defines a member called 'GenerateUserDelegationSasUri' with the same parameter types
My\runfile\obj\debug\TUnit.Mocks.SourceGenerator\TUnit.Mocks.SourceGenerator.MockGenerator\Azure_Storage_Blobs_BlobClient_MockMembers.g.cs(5605,97): error CS0111: Type 'Azure_Storage_Blobs_BlobClient_MockMemberExtensions' already defines a member called 'GenerateUserDelegationSasUri' with the same parameter types
My\runfile\obj\debug\TUnit.Mocks.SourceGenerator\TUnit.Mocks.SourceGenerator.MockGenerator\Azure_Storage_Blobs_BlobClient_MockMembers.g.cs(5612,97): error CS0111: Type 'Azure_Storage_Blobs_BlobClient_MockMemberExtensions' already defines a member called 'GenerateUserDelegationSasUri' with the same parameter types
My\runfile\obj\debug\TUnit.Mocks.SourceGenerator\TUnit.Mocks.SourceGenerator.MockGenerator\Azure_Storage_Blobs_BlobClient_MockMembers.g.cs(5619,97): error CS0111: Type 'Azure_Storage_Blobs_BlobClient_MockMemberExtensions' already defines a member called 'GenerateUserDelegationSasUri' with the same parameter types
My\runfile\obj\debug\TUnit.Mocks.SourceGenerator\TUnit.Mocks.SourceGenerator.MockGenerator\Azure_Storage_Blobs_BlobClient_MockMembers.g.cs(5627,97): error CS0111: Type 'Azure_Storage_Blobs_BlobClient_MockMemberExtensions' already defines a member called 'GenerateUserDelegationSasUri' with the same parameter types
My\runfile\obj\debug\TUnit.Mocks.SourceGenerator\TUnit.Mocks.SourceGenerator.MockGenerator\Azure_Storage_Blobs_BlobClient_MockMembers.g.cs(5634,97): error CS0111: Type 'Azure_Storage_Blobs_BlobClient_MockMemberExtensions' already defines a member called 'GenerateUserDelegationSasUri' with the same parameter types
My\runfile\obj\debug\TUnit.Mocks.SourceGenerator\TUnit.Mocks.SourceGenerator.MockGenerator\Azure_Storage_Blobs_BlobClient_MockMembers.g.cs(5642,97): error CS0111: Type 'Azure_Storage_Blobs_BlobClient_MockMemberExtensions' already defines a member called 'GenerateUserDelegationSasUri' with the same parameter types
My\runfile\obj\debug\TUnit.Mocks.SourceGenerator\TUnit.Mocks.SourceGenerator.MockGenerator\Azure_Storage_Blobs_BlobClient_MockMembers.g.cs(5650,97): error CS0111: Type 'Azure_Storage_Blobs_BlobClient_MockMemberExtensions' already defines a member called 'GenerateUserDelegationSasUri' with the same parameter types
My\runfile\obj\debug\TUnit.Mocks.SourceGenerator\TUnit.Mocks.SourceGenerator.MockGenerator\Azure_Storage_Blobs_BlobClient_MockMembers.g.cs(5687,97): error CS0111: Type 'Azure_Storage_Blobs_BlobClient_MockMemberExtensions' already defines a member called 'GenerateUserDelegationSasUri' with the same parameter types
My\runfile\obj\debug\TUnit.Mocks.SourceGenerator\TUnit.Mocks.SourceGenerator.MockGenerator\Azure_Storage_Blobs_BlobClient_MockMembers.g.cs(5693,97): error CS0111: Type 'Azure_Storage_Blobs_BlobClient_MockMemberExtensions' already defines a member called 'GenerateUserDelegationSasUri' with the same parameter types
My\runfile\obj\debug\TUnit.Mocks.SourceGenerator\TUnit.Mocks.SourceGenerator.MockGenerator\Azure_Storage_Blobs_BlobClient_MockMembers.g.cs(5700,97): error CS0111: Type 'Azure_Storage_Blobs_BlobClient_MockMemberExtensions' already defines a member called 'GenerateUserDelegationSasUri' with the same parameter types
My\runfile\obj\debug\TUnit.Mocks.SourceGenerator\TUnit.Mocks.SourceGenerator.MockGenerator\Azure_Storage_Blobs_BlobClient_MockMembers.g.cs(5707,97): error CS0111: Type 'Azure_Storage_Blobs_BlobClient_MockMemberExtensions' already defines a member called 'GenerateUserDelegationSasUri' with the same parameter types
Steps to Reproduce
#:property LangVersion=preview
#:property ManagePackageVersionsCentrally=false
#:package TUnit.Mocks@1.24.0-beta
#:package Azure.Data.Tables@12.11.0
#:package Azure.Storage.Blobs@12.27.0
using Azure.Data.Tables;
using Azure.Storage.Blobs;
var tableClientMock = Mock.Of<TableClient>(MockBehavior.Strict);
var blobClientMock = Mock.Of<BlobClient>(MockBehavior.Strict);
Console.WriteLine($"Created: {tableClientMock.Object.GetType().Name}, {blobClientMock.Object.GetType().Name}");
TUnit Version
1.24.0-beta
.NET Version
.NET10
Operating System
Windows
IDE / Test Runner
dotnet CLI (dotnet test / dotnet run)
Error Output / Stack Trace
Additional Context
No response
IDE-Specific Issue?
- I've confirmed this issue occurs when running via
dotnet testordotnet run, not just in my IDE
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working