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

ArrangeSet/MustBeCalled Not Working

2 Answers 41 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Jack L
Top achievements
Rank 1
Jack L asked on 15 May 2010, 06:08 PM
Hello,

I've started to play around with JustMock and so far I really like the API and the features. I've found one issue so far that's preventing me from switching over to JustMock, though. ArrangeSet with MustBeCalled does not appear to be working. Here's a code sample:

[TestClass] 
public class Test 
    [TestMethod] 
    public void TestFoo() 
    { 
        var mockFoo = Mock.Create<Foo>(); 
        Mock.ArrangeSet(() => mockFoo.A = 1).MustBeCalled(); 
        //mockFoo.A = 2; 
        Mock.Assert(mockFoo); 
    } 
 
public class Foo 
    public int A { getset; } 

The TestFoo test passes even though the mockFoo.A set accessor was not called. If I uncomment the mockFoo.A = 2 line, it still succeeds even though the value (2) doesn't match what was specified in the ArrangeSet Action (1).

Is this a known issue or am I missing something? This test was run in .NET 4.0 under VS2010.

Thanks,
Jack L

2 Answers, 1 is accepted

Sort by
0
Ricky
Telerik team
answered on 17 May 2010, 10:06 AM
Hi Jack,
Thanks for the issue. Yes you are right this is a bug and its fixed.  It will be available in the next internal  build coming in a few days hopefully.

Regards,
Mehfuz


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 Public Issue Tracking system and vote to affect the priority of the items.
0
Jürgen
Top achievements
Rank 1
answered on 26 May 2011, 11:01 AM
please delete this post :( I've done an error in my code. all works fine
Tags
General Discussions
Asked by
Jack L
Top achievements
Rank 1
Answers by
Ricky
Telerik team
Jürgen
Top achievements
Rank 1
Share this question
or