JustMock is a mocking framework for unit testing .NET code. The product is developed by Telerik.
Questions tagged [justmock]
104 questions
0
votes
1 answer
Just Mock, Mocking not working as expected
I am new at Just Mock, facing a problem to pass this method, need help to understand the issue.
I have a following code that I want to test
public ActionResult Create(JournalViewModel journal)
{
if (ModelState.IsValid)
{
…

Adeel
- 43
- 7
0
votes
1 answer
Telrik JustMock integration with VSTS build hosted agent
I am using Telrik JustMock to mock in the unit testing. Locally it works well but while I try to integrate it with VSTS builds based on Asp.net build template, it ends with errors.
The stacktrace for the errors are as following:
Failed …

Rupendra
- 608
- 2
- 11
- 42
0
votes
0 answers
JustMock Arrange Not Working
Ok,
Just got my licence for JustMock and it looks great. I am having an issue with Arranging my first MVC controller test thou.
My test method looks as follows:
[TestMethod]
public void Option_Detail_Test_JustMock()
{
//…

gilesrpa
- 969
- 1
- 12
- 35
0
votes
1 answer
JustMock: How to assert Method (Action a)
I am using JustMock and NServiceBus.
I want to assert that following statement is executed once:
_bus.Publish(x =>
{
x.Prop1= "Very special";
});
so that's what…
user4546142
0
votes
1 answer
How to Arrange a property of the base class using JustMockLite
I am using the free version of JustMock for writing the unit tests. I have am CustomApiController class which inherits system.web.Http.ApiController class. So from system.web.Http.ApiController class comes a property called Request (which is of…

tavier
- 1,744
- 4
- 24
- 53
0
votes
0 answers
How to mock external dependencies using JustMock Lite
I am using free version of JustMock to mock some external dependencies like GetUserSettingsResponse which is a sealed class. The problem is that the free version does not allow us to mock sealed classes. I cannot use the full version because of some…

tavier
- 1,744
- 4
- 24
- 53
0
votes
1 answer
JustMock Lite Mocking SqlConnection
I'm trying to use JustMock Lite to UnitTest a method that uses SqlConnection to call a stored proc. I obviously need to mock the database call. I have been searching, and finding it very hard to even find something even mentioning doing this. …

Limey
- 2,642
- 6
- 37
- 62
0
votes
1 answer
How can I mock the Azure Redis Cache?
How can I mock the Azure Redis Cache?
I would like to write unit test for one of my application which uses Azure Redis Cache. Since I am completely new to mocking and stubbing in writing unit test code, I am looking for help in how I can start with…

Samar Seth
- 11
- 1
- 1
0
votes
1 answer
Is it safe to use the set of unit testing frameworks in the same project?
Visual Studio
I use NUnit in my project with unit tests. But I need some tests to write with using JustMock and NSubstitute frameworks. I want to have one project with the tests for each my tested project. I.e. I don't want to have the individual…

Andrey Bushman
- 11,712
- 17
- 87
- 182
0
votes
2 answers
How to mock Internal class in Telerik
//Claim class Developed in solution ABC
class Claim
{
public Claim(string s)
{
// progreamm.....
}
}
//Test Case needs to write in Solution XYZ
[TestClass]
public class ClaimTest
{
public void myconstructor()
{
…

Chetan
- 27
- 4
0
votes
2 answers
When using Ninject for dependeny injection is it best practices to use Ninject in your unit tests or use a mocking framework
I am using ninject to inject dependencies in my production environment. I see two options when it comes to writing unit tests. I can either create concrete classes and inject them using ninject, Or I can use a mocking framework like just mock.
My…

Manny Williams
- 11
- 2
0
votes
1 answer
Telerik JustMock a Property Read
I am trying to mock a Property using Telerik JustMock.
public WorkitemBusinessObject mock()
{
var mockContext = Mock.Create>();
var workitemList = new List {
new…

Frank Michael Kraft
- 2,302
- 5
- 25
- 30
0
votes
1 answer
How to arrange and assert MustBeCalled for property setter in JustMock
I have a mocked class with a property that has a get and set. My code under test calls the setter to assign a connection string value. My test code mocks the class that contains the property and I add MustBeCalled when I arrange the mock.
ViewModel…

ihatemash
- 1,474
- 3
- 21
- 42
0
votes
2 answers
Trouble with Mock.Assert() for sequential calls with different argument values to mock
Could someone please take a look at the demo code below and let me know if what I'm seeing is due to error on my part or a Telerik issue?
I'm using Telerik.JustMock v. 2014.1.1519.1. and Microsoft.VisualStudio.QualityTools.UnitTestFramework v.…

RobC
- 1,303
- 3
- 15
- 32
0
votes
1 answer
JustMock: Mocking Static method call not working
Using JustMock:
I am not sure why my arrange call for a static method is trying to execute the original.
[Test]
public void RunCompleteDivxJob_Negative_Exception()
{
DebugView.IsTraceEnabled = true;
var mediaId = 2000999;
var…

dcinadr
- 665
- 2
- 7
- 24