JustMock 2024.4.1203.350
Prefix Reserveddotnet add package JustMock --version 2024.4.1203.350
NuGet\Install-Package JustMock -Version 2024.4.1203.350
<PackageReference Include="JustMock" Version="2024.4.1203.350" />
paket add JustMock --version 2024.4.1203.350
#r "nuget: JustMock, 2024.4.1203.350"
// Install JustMock as a Cake Addin #addin nuget:?package=JustMock&version=2024.4.1203.350 // Install JustMock as a Cake Tool #tool nuget:?package=JustMock&version=2024.4.1203.350
JustMock Lite
JustMock Lite is the most powerful free mocking framework available for .NET developers who practice unit testing and want to deliver exceptional software. It cuts your development time and helps you create better unit tests. It also enables you to perform fast and controlled tests that are independent of external dependencies like databases, web services or proprietary code. For more information, refer to the git repository or our JustMock Lite website.
JustMock Lite Key Features
- AAA pattern – JustMockLite uses the Arrange Act Assert (AAA) pattern.
- Error-Free Mocking - Thanks to its strongly typed framework API, JustMock detects errors in your mock definitions and highlights them in Visual Studio. The JustMock Lite API fully leverages Visual Studio IntelliSense to make it easy to start mocking.
- Mock interfaces - Allows you to test public interfaces.
- Mock classes - Allows you to test public classes.
- Mock properties - Allows you to test the property getter and setter.
- Mock and rise events - Allows you to test events.
- Control mock behavior - Allows you to control the default behavior of a mock whether be to do nothing, call the original code or throw an exception.
- Assert call occurrences - Allows you to determine how many times a call has occurred.
- Recursive mocking - Еnable you to mock members that are obtained as a result of "chained" calls on a mock.
- Sequential mocking - Allows you to return different values on the same or different consecutive calls to one and the same type.
- Support for out/ref - Mock methods accepting our and ref parameters.
- Support for Generics - Mock generic classes and methods.
- Fluent mocking - Allows you setup your test arrangements and expectations from your mock object.
- Being able to seamlessly upgrade to JustMock - No rework of test is required. Simply install JustMock and make sure your project is referencing the correct assemblies.
- And many more.
JustMock
JustMock Lite is backed by a commercial version JustMock which is more advanced mocking framework based on JustMock Lite. JustMock is for developers who doesn't want to have any restrictions and be able to mock literally everything. For more information visit our JustMock website.
JustMock Key Features
- All key features from JustMock Lite
- Mock non-public members and types - Allows you to mock non-public members or types.
- Mock non-virtual methods - Allows you to mock non-virtual methods.
- Mock extension method - Allows you to mock extension methods.
- Mock static classes, methods, and properties - Allows you to mock static constructors, methods and properties getters and setters, set expectations and verify results.
- Mock sealed classes - Allows you to mock sealed classes and calls to their methods/properties
- Mock partial mocking - Allows you keep your original object and mock only the required methods.
- Mock LINQ queries - Allows you to mock LINQ queries with custom select.
- Mock DLL imports - Allows you to mock imported functions (decorated with the [DLLImport()] attribute)
- Mock Ref return values and ref locals - Allows you to arrange and verify Ref return and Ref locals
- Mock Local functions - Allows you mock Local functions.
- Mock MsCorLib members - Allows you to mock types and methods from .NET Framework/.NET Core, i.e. from MsCorLib.
- Mock Microsoft SharePoint - Allows you to mock types and method from SharePoint.
- Mock Microsoft EntityFramework - Allows you to easily create in-memory mocks of the DbSet and DbContext types.
- And many more
Licensing
This distribution of JustMock Lite is made available pursuant to the Progress® Telerik® JustMock EULA at https://www.telerik.com/purchase/license-agreements, unless you have entered into a separate software license agreement with the licensor that covers JustMock Lite. Source code in the repository on GitHub is made available under Apache-2.0.
Examples
[TestMethod]
public void TestBookService()
{
// Arrange - initialize objects and prepare data.
var repository = Mock.Create<IBookRepository>();
var expectedBook = new Book { Title = "Adventures" };
var service = new BookService(repository);
// prepare an expectation of what the GetWhere method should do when called with the specified parameters
// and how many times the call is supposed to occur.
Mock.Arrange(() => repository.GetWhere(book => book.Id == 1)).Returns(expectedBook).OccursOnce();
// Act - execute the tested logic.
Book actualBook = service.GetSingleBook(1);
// Assert - verify that the actual result is equal to the expected.
Assert.AreEqual(expectedBook.Title, actualBook.Title);
}
Supported .NET Frameworks
- .NET Framework 4.7.2 and later.
- .NET LTS/STS versions via .NET Standard 2.1
Documentation
JustMock Lite and JustMock are coming with extensive Documentation and examples that will help you quickly get started with the framework.
Feedback
JustMock Lite is constantly improved through customer interaction and feedback. If you want to suggest a new feature, bug report or vote for a popular one, please visit our Feedback Portal.
Happy mocking!
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.1 is compatible. |
.NET Framework | net472 is compatible. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.1
- System.Security.Permissions (>= 8.0.0)
NuGet packages (6)
Showing the top 5 NuGet packages that depend on JustMock:
Package | Downloads |
---|---|
JustMock.EntityFramework
Mock DbSet and DbContext mocking amenities for JustMock Lite. |
|
JustMock.Autofac
Mocking container extension for unit-testing Autofac-based projects. |
|
JustMock.Unity
Mocking container extension for unit-testing Unity-based projects. |
|
JustMock.Mef
Export provider and mocking container for unit-testing MEF-based projects. |
|
ShopAtHome.UnitTestHelper
A collection of stub interface builders and test data creators, helpful in creating robust and easily maintained suites of unit tests |
GitHub repositories (10)
Showing the top 5 popular GitHub repositories that depend on JustMock:
Repository | Stars |
---|---|
AutomateThePlanet/AutomateThePlanet-Learning-Series
Automate The Planet Series Source Code
|
|
axzxs2001/Asp.NetCoreExperiment
原来所有项目都移动到**OleVersion**目录下进行保留。新的案例装以.net 5.0为主,一部分对以前案例进行升级,一部分将以前的工作经验总结出来,以供大家参考!
|
|
telerik/blazor-ui
A collection of examples related to Telerik UI for Blazor Components: https://www.telerik.com/blazor-ui
|
|
shahedc/NetLearnerApp
NetLearner: The Internet Resource Learning Helper built with ASP .NET Core
|
|
ardalis/ddd-vet-sample
A sample meant to demonstrate domain driven design using a veterinary hospital management system.
|
Version | Downloads | Last updated |
---|---|---|
2024.4.1203.350 | 111 | 12/5/2024 |
2024.4.1113.345 | 3,772 | 11/13/2024 |
2024.3.805.336 | 22,789 | 8/7/2024 |
2024.2.514.325 | 24,831 | 5/15/2024 |
2024.1.124.247 | 62,135 | 1/31/2024 |
2023.3.1122.188 | 33,681 | 11/23/2023 |
2023.3.1011.155 | 20,939 | 10/11/2023 |
2023.2.719.137 | 54,709 | 7/19/2023 |
2023.2.629.130 | 8,127 | 7/4/2023 |
2023.2.601.35 | 28,725 | 6/2/2023 |
2023.1.117.1 | 176,050 | 1/18/2023 |
2022.3.1109.1 | 49,271 | 11/14/2022 |
2022.3.912.3 | 62,341 | 9/14/2022 |
2022.2.621.1 | 32,426 | 6/22/2022 |
2022.2.511.1 | 26,113 | 5/11/2022 |
2022.1.223.1 | 37,097 | 2/23/2022 |
2022.1.119.1 | 65,533 | 1/19/2022 |
2021.3.1110.2 | 97,165 | 11/10/2021 |
2021.3.915.1 | 44,233 | 9/16/2021 |
2021.2.615.4 | 57,157 | 6/16/2021 |
2021.2.511.1 | 16,608 | 5/12/2021 |
2021.1.222.1 | 83,175 | 2/24/2021 |
2021.1.115.1 | 18,140 | 1/20/2021 |
2020.3.1124.2 | 32,531 | 11/24/2020 |
2020.3.1019.2 | 33,016 | 10/21/2020 |
2020.3.916.1 | 24,177 | 9/16/2020 |
2020.2.616.1 | 68,435 | 6/17/2020 |
2020.2.513.1 | 24,821 | 5/13/2020 |
2020.1.113.1 | 67,542 | 1/15/2020 |
2019.3.910.4 | 114,803 | 9/18/2019 |
2019.2.620.1 | 109,039 | 6/20/2019 |
2019.2.508.1 | 33,443 | 5/15/2019 |
2019.1.207.1 | 58,298 | 2/7/2019 |
2019.1.115.2 | 18,203 | 1/16/2019 |
2018.3.912.1 | 155,891 | 9/12/2018 |
2018.1.117.2 | 193,135 | 1/18/2018 |
2017.2.821.1 | 107,472 | 8/24/2017 |
2016.2.426.1 | 192,911 | 5/4/2016 |
2016.1.307.3 | 53,700 | 3/7/2016 |
2016.1.107.7 | 34,170 | 1/13/2016 |
2015.3.929.5 | 26,727 | 9/30/2015 |
2015.2.715.1 | 74,877 | 7/21/2015 |
2015.2.616.2 | 22,953 | 6/24/2015 |
2015.1.224.3 | 49,445 | 2/25/2015 |
2015.1.205.2 | 2,690 | 2/16/2015 |
2014.3.1204.3 | 16,725 | 12/4/2014 |
2014.3.1021.2 | 3,843 | 10/27/2014 |
2014.2.811.1 | 13,514 | 8/11/2014 |
2014.2.722.1 | 3,047 | 7/22/2014 |
2014.2.609.3 | 4,205 | 6/13/2014 |
2014.1.1623.1 | 7,835 | 4/24/2014 |
2014.1.1609.1 | 4,242 | 4/15/2014 |
2014.1.1519.1 | 4,654 | 3/31/2014 |
2014.1.1424.1 | 11,214 | 2/26/2014 |
2014.1.1418.1 | 2,887 | 2/19/2014 |
2014.1.1317.4 | 2,893 | 1/28/2014 |
2014.1.1307.2 | 2,732 | 1/9/2014 |
2014.1.1217.4 | 3,167 | 12/18/2013 |
2014.1.1204.1 | 2,747 | 12/4/2013 |
2013.3.1119.2 | 3,632 | 11/20/2013 |
2013.3.1101.2 | 4,031 | 11/1/2013 |
2013.3.1015 | 4,142 | 10/16/2013 |
2013.3.1009 | 3,048 | 10/10/2013 |
2013.3.925 | 2,545 | 9/26/2013 |
2013.3.904 | 3,151 | 9/6/2013 |
2013.3.819 | 9,965 | 8/19/2013 |
2013.3.813 | 2,150 | 8/13/2013 |
2013.2.611 | 10,865 | 6/12/2013 |
2013.2.603 | 2,283 | 6/3/2013 |
2013.2.527 | 2,221 | 5/27/2013 |
2013.2.522 | 2,217 | 5/22/2013 |
2013.1.507 | 2,142 | 5/8/2013 |
2013.1.315 | 5,056 | 3/18/2013 |
2013.1.220 | 3,548 | 2/20/2013 |
2013.1.125.1 | 2,567 | 1/25/2013 |
2012.3.1220 | 2,463 | 12/21/2012 |
2012.3.1016 | 3,105 | 10/17/2012 |
2012.2.813 | 4,820 | 8/13/2012 |
2012.1.608 | 3,386 | 6/11/2012 |
2012.1.508 | 2,295 | 5/8/2012 |
2012.1.321 | 2,467 | 3/21/2012 |
2012.1.229 | 2,387 | 3/1/2012 |
2012.1.215 | 2,203 | 2/15/2012 |
2011.3.1323 | 2,315 | 1/23/2012 |
2011.3.1222 | 2,318 | 12/22/2011 |
2011.3.1116 | 2,526 | 11/16/2011 |
2011.2.921 | 2,498 | 9/29/2011 |
2011.2.713 | 3,020 | 7/22/2011 |
2011.1.620 | 2,502 | 6/20/2011 |
2011.1.331 | 2,796 | 4/7/2011 |
2011.1.315 | 3,078 | 3/16/2011 |
2010.3.1215 | 4,798 | 1/7/2011 |
To check the latest release notes visit https://www.telerik.com/support/whats-new/justmock/release-history