JustMock Lite

Free and easy mocking framework
Home/Products/JustMock/JustMock Lite

Free Mocking Framework

For developers who practice unit testing and want to deliver exceptional software, JustMock Lite is the superior free mocking framework that makes unit testing simpler for SOLID testable projects. JustMock Lite is easy to use, feature rich, with great power and flexibility, making it the superior choice. JustMock Lite cuts your development time and helps you create better unit tests. It allows you to perform fast and controlled tests that are independent of external dependencies like databases, web services, or proprietary code. JustMock Lite is the same set of assemblies as the commercial edition of JustMock, and just like JustMock, is commercially backed with 3 major releases per year and continuous product improvement. 

If you are dealing with a legacy code project or tightly coupled code that requires elevated mocking (such as mocking private, static, or sealed items), you need the JustMock full edition.

 

NuGet Package for Visual Studio

Why choose:

Superior Free Mocking Framework

JustMock Lite integrates with all .NET unit testing frameworks and works with all .NET continuous integration/build servers. JustMock Lite helps unit test a complex behavior by easily isolating dependencies, allowing for higher code coverage as well as exposing bugs and side effects from code changes. It offers automatic feedback as a step in verifying expected behavior of the system under test. JustMock Lite allows you to quickly add use cases to your unit tests, expanding scenario coverage. JustMock Lite supports a long list of features, including automocking, ordered assertions, mocking events, and sequential mocking, all with an easy to discover fluent interface. Take a look at the table below for a list of features and comparison with the JustMock full edition.

Commercially Backed

JustMock Lite follows the same release cycle as JustMock full edition with 3 major releases per year, each introducing cutting edge improvements and new features.

Mocks SOLID Code

If your code follows the SOLID principles, then JustMock Lite is the right framework for you. If your code is designed for testability and is loosely coupled JustMock Lite will help you write high quality software through fast and easy unit testing. If your project contains legacy code, use the JustMock full edition for elevated mocking. The table below shows a full comparison between the two editions of JustMock.

Arrange, Act, Assert Oriented

JustMock Lite utilizes the Arrange, Act, Assert (AAA) pattern for creating unit test mocks. This simple pattern makes it easy for developers to quickly and naturally mock objects in unit tests.

Error-free Mocking

Thanks to its strongly typed framework API JustMock detects errors in your mock definitions and highlights them in Visual Studio. JustMock Lite's API fully leverages Visual Studio IntelliSense to make it easy to start mocking.

Automocking

Automocking eliminates the time and effort needed to manage mocking the dependencies in the system under test by automating the process. Automocking provides significant benefit to testing classes with many dependencies or dependencies that change over time.

Easy Migration to JustMock Full Edition

When you decide you need a more powerful mocking experience you can easily migrate to the paid version of JustMock. With it you can mock objects like non-virtual methods, sealed classes and static methods and classes, non-public members and types.

Explore JustMock Full Edition

JustMock Edition Comparison


Feature JustMock Full Edition
JustMock Lite Edition
Close The CallOriginal method marks a mocked method/property call that should execute the original method/property implementation. This topic goes through a number of scenarios where the CallOriginal method is usefull.
Call Original
Yes Yes
Close The DoNothing method is used to arrange that a call to a method or property should be ignored. It is applicable only for methods without a return value and property sets.
Do Nothing
Yes Yes
Close The DoInstead method is used to replace the actual implementation of a method with a mocked one. This topic goes through a number of scenarios where the DoInstead method is useful.
Do Instead
Yes Yes
Close The Initialize method is used for setting up all framework methods during test initialization.
Initialize
Yes Not Supported
Close The MustBeCalled method is used to assert that a call to a given method or property is made during the execution of a test.
Must Be Called
Yes Yes
Close The Raise method is used for raising mocked events. You can use custom or standard events.
Raise
Yes Yes
Close The Returns method is used with non void calls to ignore the actual call and return a custom value. This topic goes through a number of scenarios where the Returns method is useful.
Returns
Yes Yes
Close The Throws method is used to throw an exception when a given call is made. This topic goes through a number of scenarios where the Throws method is useful.
Throws
Yes Yes
Close Telerik JustMock allows you to mock generic classes/interfaces/methods in the same way as you do it for non-generic ones.
Generics
Yes Yes
Close By default Telerik JustMock uses loose mocks and allows you to call any method on a given type. No matter whether the method call is arranged or not you are able to call it. However, you may have a case where you want to enable only arranged calls and to reject any other calls. In such cases you need to set the to Strict when creating the mock.
Strict Mocking
Yes Yes
Close Mocking properties is similar to mocking methods, but there are a few cases that need special attention like mocking indexers and particular set operations.
Mock Properties
Yes Yes
Close Occurrence is used in conjunction with Mock.Assert and Mock.AssertSet to determine how many times a call has occurred.
Asserting Occurrences
Yes Yes
Close Matchers let you ignore passing actual values as arguments used in mocks. Instead, they give you the possibility to pass just an expression that satisfies the argument type or the expected value range.
Matchers
Yes Yes
Close Sequential mocking allows you to return different values on the same or different consecutive calls to one and the same type. In other words, you can set up expectations for successive calls of the same type.
Sequential Mocking
Yes Yes
Close Recursive mocks enable you to mock members that are obtained as a result of "chained" calls on a mock. For example, recursive mocking is useful in the cases when you test code like this: foo.Bar.Baz.Do("x").
Recursive Mocking
Yes Yes
Close With JustMock you can mock internal types with InternalsVisibleToAttribute the same way you mock public types. Without InternalsVisibleToAttribute you are forced to mock as you mock non-public members.
Mock Internal Types Via Proxy
Yes Yes
Close Automocking allows you to create an instance of a class (the system under test) without having to explicitly create each individual dependency as a unique mock. The mocked dependencies are still available if methods or properties need to be arranged as part of the test.
Automocking
Yes Yes
Close Microsoft SharePoint is a browser based web platform where you can set up Web sites to share and manage information and documents and publish reports in order to make it easier for people to work together.
SharePoint Mocking
Yes Not Supported
Close Telerik JustMock can be used in conjunction with Telerik OpenAccess to fake the data access layer to make it easier for you to test your target logic without worrying about its dependencies.
OpenAccess Mocking
Yes Not Supported
Close With Microsoft Entity Framework you develop data access application by using a conceptual application model instead of relational storage schema.
Entity Framework Mocking
Yes Not Supported
Close Final mocking is one of the advanced features supported in Telerik JustMock. It allows you to fake final method/property calls, set expectations and verify results using the AAA principle. Faking final or virtual method/property calls doesn't affect the way you write your tests, i.e. the same syntax is used for mocking both final and non-final calls.
Final Mocking
Yes Not Supported
Close Sealed mocking is one of the advanced features supported in Telerik JustMock. It allows you to fake sealed classes and calls to their methods/properties, set expectations and verify results using the AAA principle. Faking sealed classes and calls to their methods/properties doesn't affect the way you write your tests, i.e. the same syntax is used for mocking non sealed classes.
Sealed Mocking
Yes Not Supported
Close Static mocking is one of the advanced features supported in Telerik JustMock. It allows you to fake static method/property calls, set expectations and verify results using the AAA principle. Whether you mock static or instance calls there isn't much difference in the way your organize and write your tests.
Static Mocking
Yes Not Supported
Close Partial mocks allow you to mock some of the methods of a class while keeping the rest intact. Thus, you keep your original object, not a mock object, and you are still able to write your test methods in isolation. Partial mocking can be performed on both static and instance calls.
Partial Mocking
Yes Not Supported
Close Telerik JustMock enables you to mock methods from the .NET Framework, i.e. from MsCorlib. By adding some additional lines during your test class initialization you can easily mock even methods from MsCorlib.
MsCorlib Mocking
Yes Not Supported
Close In elevated mode, you can use Telerik JustMock to mock non-public members and types. That is useful when you want to isolate calls to non-public members.
Mocking Non-public Members and Types
Yes Not Supported
Close With JustMock you can mock LINQ queries with custom select.
Mocking LINQ Queries
Yes Not Supported
Close Threadpool mocking is one of the advanced features supported in Telerik JustMock. It allows you to access mocked objects inside another thread and work with them as expected.
Threadpool Mocking
Yes Not Supported
Close Extension Methods mocking is one of the advanced features supported in Telerik JustMock. By using it you can easily assert expectations related to extension methods in your tests.
Extension Methods Mocking
Yes Not Supported
Free trial Download

Feedback Portal

JustMock Lite is constantly improved through customer interaction and feedback. If you want to suggest a new feature or vote for a popular one, please visit our Feedback Portal.

Extensive Documentation and Examples

JustMock Lite comes with extensive documentation and examples that will help you quickly get started with the framework. You can also browse our Resources page, where you will find FAQs, blog posts, videos, and additional learning resources related to unit testing and mocking.