r2-2018-short-banner

Telerik JustMock

Release History

JustMock 2010.2810

August 9, 2010

What's new:
  • Support for mocking in F# has been added (a new sample F# solution has also been included in the installation).


What's fixed:
  • Mock.Assert should throw proper exception when used with partial members and MustBeCalled.

  • Should be able to set / get property as if in a real object for loose mocks.
    var foo = Mock.Create<IFoo>();
    foo.Name = "Spike";
    Assert.Equal("Spike", foo.Name);

  • Should be able to mock items from multiple projects, was failing for certain cases.
  • Should be able to assert calls with mocked parameters.
    FooResult result = Mock.Create<FooResult>();
    var data = Mock.Create<IDataAccess>();
    data.ProcessFilterResult(result, "a", "b");
    Mock.Assert(() => data.ProcessFilterResult(result, "a", "b"), Occurs.Once());

  • Framework method Ex. File.Delete was failing for VB, when wrapped in a class.
  • Moved ReturnsCollection to Telerik.JustMock.Helpers.
    The “ReturnsCollection” method does a number of tasks on behalf of the developer and is not required for all cases except for IQueryable / IEnumerable implementations. That's why we decided to make it an extension method and move it to a separate namespace.

  • Concrete calls made within proxy constructor through base should not crash the proxy (Entity framework related).
    [TestMethod, Description("mimics a scenario from an entity framework container")]
    public void ShouldAssertConcreteDuringIntializationOfAProxyMock()
    {
        var container = Mock.Create<KiggContainer>("data=telerik");
        // just call.
        container.Do();
    }

    public class KiggContainer
    {
        public KiggContainer(string connection)
        {
            Do();
        }
        public void Do()
        {
        }
    }

  • Fixed an issue with mocking concrete methods with constraints.
    [TestMethod]
    public void ShouldMockConcreteMethodWithGenericConstraint()
    {
        var container = Mock.Create<Container>();
        container.InsertOnSubmit<Category>(new Category());
    }
    public class Container
    {
        public void InsertOnSubmit<TEntity>(TEntity entity)
        where TEntity : EntityObject
        {
            throw new NotImplementedException();
        }
    }
    public class EntityObject
    {
    }
    public class Category : EntityObject
    {
    }
  • Should automatically intercept final methods from base.
    [TestMethod]
    public void ShouldConsiderFinalMethodsFromBase()
    {
        var foo = Mock.Create<FooBaseImplement>();
        foo.Echo();
    }
    public class FooBase
    {
        public void Echo()
        {
            throw new Exception();
        }
    }
    public class FooBaseImplement : FooBase
    {
    }

  • Should be able to use JustMock.dll without the Telerik.CodeWeaver.Hook.dll when mocking only virtual members.

  • Fixed an internal type load exception for mocking certain large objects.

  • Fixed invalid dynamic assembly generation for certain cases.

  • Added missing signature in Mock.Partial to mock mscorlib members from System.Enviroment.

Telerik JustMock

Product overview Buy Try

New features & Roadmap

Have a feature request?

Post your feedback via the JustMock Feedback portal or the Public forums

What's new across all Telerik products?

See all updates

Next Steps

Download Free Trial

With dedicated technical support.

Check Pricing

Purchase individual products or any of the bundles