Contact Sales: +1-888-365-2779
Community & Support
Home/Community & Support/JustMock Beta

Telerik Labs

JustMock Beta

Beta Posted in

JustMock is a new developer productivity tool designed to make it easy to create unit tests. JustMock cuts your development time and helps you create better unit tests without requiring you to change your code. It allows you to perform fast and controlled tests that are independent of external dependencies like databases, web services, or proprietary code. With JustMock, there are also no limits to what you can mock! You can fake non-virtual methods, sealed classes, and static methods and classes.

Asserting Occurrences
With JustMock occurrences can be used in conjunction with the Mock.Assert function. Whit its help you can further verify how many times a call has occurred.

Mocking with Matchers
With the help of the matchers you can ignore an argument for a particular mock. For example you can process only those calls that satisfy a specific expression or argument from an expected value range.

Matchers can also be used in assertion. Consider a fictitious payment service where you don't care what the payment date is, but you want to make sure that the payment amount that is passed to the service is exactly $54.44.

Mocking Framework methods
JustMock supports mocking types coming from the core framework libraries like mscorlib, System, etc. Additionally JustMock facilitates mocking some fairly used classes like DateTime and File.

Mocking properties

JustMock supports mocking of properties:

  • Mocking get calls – the Getter of a property can be mocked like any other method calls. You can set a particular return for a specific call or throw an exception or even raise an event when invoked.
  • Mocking indexers - Indexers are a special kind of properties that enable you to access the class as if it is an array.
  • Mocking a particular set operation – Set operations can be mocked both for indexers and normal properties. Property set mocking is useful when you want to make verify that a particular property is set with the expected value.

Partial mocking
JustMock allows you to mock particular calls on demand. Partial mocking can be performed both on static and instance calls. Have in mind that extension method mocking is set to partial by default.

Recursive/ Nested mocking
Recursive mocking gives you the ability to mock members that have originated from calls that have occurred in your current mock instance.

Sequential Mocking
Very often you need to return different values on subsequent calls of the same type. Sequential mocking helps you achieve just that.

Static mocking
JustMock can mock classes that are dependent on static calls or otherwise known as static methods. Furthermore the tool can work with extension methods, which are a special kind of static methods, but they are called as if they were instance

Tags: new product mocking tool JustMock

Related Resources