Completed
Last Updated: 20 Feb 2020 07:05 by ADMIN
Sergio
Created on: 19 Feb 2020 09:35
Type: Bug Report
0
Trying to use "Telerik.JustMock.Xunit.AssertFailedException" fails to compile

Hello,

According to the JustMock documentation, to validate a method on the mock was called it should be done like so:

[TestMethod] 
public void ShouldThrowExceptionWhenMustBeCalledSetupIsNeverInvoked() 
{ 
    // Arrange 
    var foo = new Foo(); 

    Mock.Arrange(() => foo.Execute()).MustBeCalled(); 

    // Assert 
    Assert.Throws<AssertFailedException>(() => Mock.Assert(foo)); 
}

When I do that, the application fails to compile saying the type AssertFailedException does not exist, even though I have the using statement for the Telerik.JustMock assembly at the top of my file. If I try to fully qualify it like so:

Assert.Throws<Telerik.JustMock.Xunit.AssertFailedException>

I get the same message for the "Xunit" namespace.

I know that the type should exist since when I run the test asserting a different type of Exception, the test fails saying it expects an exception of type Telerik.JustMock.Xunit.AssertFailedException.

I am attaching a couple of images that illustrate the problem.

Thank you.

 

1 comment
ADMIN
Mihail
Posted on: 20 Feb 2020 07:05

The fix is available with R1 2020 SP1 - version 2020.1.219.1

Regards,
Mihail
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