This is a migrated thread and some comments may be shown as answers.

Mocking Azure connection

1 Answer 88 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
allan
Top achievements
Rank 1
allan asked on 06 Feb 2019, 10:43 PM

Hey all, 

New to mocking so bare with me :-)

trying to create a mock up of and AzureConnection within my function app. To create the connection to Azure i have a class "AzureConnection.cs that initiates a connection to Azure using "IAuthenticated Authenticate" iam able to Mock this without issues, but when i try to arrange my connection to always return a specific TenantId it fails!

            var AzureConnectionMock = Mock.Create<AzureConnection>(Behavior.Loose);
            Mock.Arrange(() => AzureConnectionMock.AzureAuthenticated.TenantId)
                .Returns("MyTenantID");

Maybe iam doing this completely wrong, thus hopping someone could help?

Thx

1 Answer, 1 is accepted

Sort by
0
Lyubomir Rusev
Telerik team
answered on 08 Feb 2019, 09:18 AM
Hi Allan,

First of all, I want to welcome you joining the JustMock community. JustMock is a very powerful tool and will definitely suit your requirements.

Regarding your issue, I want to ask you what is the version of JustMock that you use - free or commercial? Also, is it possible to provide us with the exact error that you receive? Looking forward to your response!

Regards,
Lyubomir Rusev
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
General Discussions
Asked by
allan
Top achievements
Rank 1
Answers by
Lyubomir Rusev
Telerik team
Share this question
or