Completed
Last Updated: 24 Nov 2015 08:37 by Simo
Anand
Created on: 22 Mar 2013 05:13
Type: Bug Report
0
Mock.SetupStatic not working with RoleEnvironment
I have installed the trial version of JustMock to evaluate it. I have been trying to mock the static calls of Azure RoleEnvironment class, but the SetupStatic does not work. It seems to be calling the original method. Please see my simple test below:

[Test]
public void VerifyRoleEnvironment()
{
       bool expected = true;
       Mock.SetupStatic(typeof(RoleEnvironment), StaticConstructor.Mocked);
       Mock.Arrange(() => RoleEnvironment.IsAvailable).Returns(true);
       Assert.AreEqual(expected, RoleEnvironment.IsAvailable);
}
1 comment
Simo
Posted on: 24 Nov 2015 08:37
Try to enable JustMock profiler. It locates on Visual Studio menu -> JUSTMOCK