ArrangeSet/MustBeCalled Not Working

3 posts, 0 answers
  1. Jack L
    Jack L avatar
    1 posts
    Member since:
    May 2010

    Posted 15 May 2010 Link to this post


    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:

    public class Test 
        public void TestFoo() 
            var mockFoo = Mock.Create<Foo>(); 
            Mock.ArrangeSet(() => mockFoo.A = 1).MustBeCalled(); 
            //mockFoo.A = 2; 
    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.

    Jack L
  2. Ricky
    Ricky avatar
    467 posts

    Posted 17 May 2010 Link to this post

    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.


    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.
  3. Jürgen
    Jürgen avatar
    4 posts
    Member since:
    Sep 2012

    Posted 26 May 2011 Link to this post

    please delete this post :( I've done an error in my code. all works fine
Back to Top