GitHub - telerik/JustMockLite: Powerful and free mocking for .NET (original) (raw)

JustMock Lite

nuget license

JustMock Lite by Telerik is 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. It is also an open source product that 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 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 our JustMock Lite website.

JustMock Lite Key Features

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

Licensing

Packaged distributions of Progress Telerik JustMock Lite obtained from NuGet are made available pursuant to the Progress Telerik JustMock EULA at https://www.telerik.com/purchase/license-agreements, unless you have entered into a separate MSA with the licensor.

Source code obtained from the Progress Telerik JustMock Lite GitHub repository is made available under Apache-2.0.

Examples

[TestMethod] public void TestBookService() { // Arrange - initialize objects and prepare data. var repository = Mock.Create(); 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

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!