Mocking Azure connection

2 posts, 0 answers
  1. allan
    allan avatar
    1 posts
    Member since:
    Feb 2019

    Posted 06 Feb 2019 Link to this post

    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

  2. Lyubomir Rusev
    Admin
    Lyubomir Rusev avatar
    4 posts

    Posted 08 Feb 2019 Link to this post

    Hi Allan,

    First of all, I want to welcome you for 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
Back to Top