Questions tagged [justmock]

JustMock is a mocking framework for unit testing .NET code. The product is developed by Telerik.

104 questions
26
votes
6 answers

Rhino mock vs Typemock vs JustMock vs

I need to choose mock framework to new project. What are the pros and cons for those frameworks? Any comparison table? I know that JustMock is i beta stage but it's look very good right now (very similar to TypeMock) Edit: I'v What about MS Mole?…
Adiel
  • 331
  • 1
  • 4
  • 10
10
votes
3 answers

TypeMock VS JustMock (VS RhinoMock,Moq...): current situation in 2011?

I've started TDD some weeks ago. I have to do Unit Tests on a C# code full of non-virtual methods and there is no much interface either. Therefore, after I've been studying RhinoMock and Moq, a proxy solution wasn't enough: what I need is an…
Jeco
  • 1,080
  • 8
  • 11
9
votes
1 answer

Unit Testing Parallel.Foreach C#

I have been using JustMock for unit testing in C#. The problem I am facing is I cannot assert the functions called inside Parallel.Foreach. However the assignments done inside can be asserted. Parallel.ForEach(aList, entity => { //Can be…
Sunny
  • 517
  • 5
  • 17
7
votes
2 answers

Can JustMock return a value based on the parameter?

Using JustMock, can I arrange a mock to return something based on the input parameter? For example, say a method takes in an int, I want to return that value + 1 I want the output to always be mocked as input+1 but I don't know the input at design…
Matthew
  • 10,244
  • 5
  • 49
  • 104
7
votes
1 answer

Mocking a simple service bus in ASP.NET MVC

I have a simple 'Service' system set up with an interface as shown below. I am trying to mock it for use in my unit testing, but am having a bit of an obstacle. The way it works is that I design classes that implement IRequestFor and I would…
Ciel
  • 17,312
  • 21
  • 104
  • 199
6
votes
1 answer

How to mock a constructor with JustMock?

I'm trying to test the following code: public ICollection ReadCatalog(string familyName) { // Root folder for the family string familyFolder = this.GetFamilyFolder(familyName); DirectoryInfo familyFolderInfo = new…
Ignacio Soler Garcia
  • 21,122
  • 31
  • 128
  • 207
6
votes
2 answers

ASP.NET-MVC4 Code Not Running

I have a simple MVC4 solution that works just fine until I set a breakpoint in the controller. If I do that, the breakpoint does not hit, and I get a pop-up window titled, "Source Not Available" that goes on to say "Code not running", then "The…
Kelly Cline
  • 2,206
  • 2
  • 33
  • 57
5
votes
0 answers

The operands for operator 'Equal' do not match the parameters of method 'op_Equality' when running a unit test with just mock

We are currently running this expression return x => x.ObjectType != null && x.ObjectType == "SERVICE" && x.Service.Id == searchValue; Which works fine until we come to do a unit test with just mock and it fails with the…
paj7777
  • 311
  • 1
  • 4
  • 13
4
votes
2 answers

TestFixtureSetUpAttribute not found in JustMock?

I'm developing a TDD test with C#, .NET Framework 4.7, Nunit 3.8.0 and JustMock Lite 2017.2.821.1. When I do this: IGenericRepository _proOrdRepository = Mock.Create>(); I get…
VansFannel
  • 45,055
  • 107
  • 359
  • 626
4
votes
1 answer

JustMock vs. TypeMock vs. Other

With Telerik's JustMock product newly available, it has a lot of similarities to TypeMock, in the ability to mock concrete classes, not just abstract classes or interfaces. I was just curious your opinion on one or both of the products. What do…
Brian Mains
  • 50,520
  • 35
  • 148
  • 257
4
votes
1 answer

Cannot mock .... The profiler must be enabled to mock, arrange or execute the specified target

I have the following in a test (my first ever JustMock test, I might add)... var template = Mock.Create(); Mock.Arrange(() => template.Subject) .Returns("This template has Zero tokens."); …
Stuart Hemming
  • 1,553
  • 2
  • 21
  • 44
4
votes
4 answers

Sitecore Unit Testing is not a success?

We have done research to Unit Testing in our company. In my company we make custom .NET, Sitefinity and especially Sitecore. We have made successfully Unit Tests for custom .NET and Sitefinity, but we could not really get to useful tests. For…
dpwulp94
  • 163
  • 1
  • 8
4
votes
3 answers

Mock Concrete FileInfo Object

I would like to Mock the System.IO.FileInfo.Extension Method and have it return ".xls" but I can't get anything to work This Example works great for Delete but not for Extension (The code will not compile) [ClassInitialize] public static…
Micah Armantrout
  • 6,781
  • 4
  • 40
  • 66
3
votes
2 answers

Mocking ConfigurationManager.AppSettings with JustMock

Following the directions at: http://www.telerik.com/help/justmock/advanced-usage-static-mocking.html I'm unsuccessful in mocking ConfigurationManager.AppSettings. Here's the code I'm using... [TestMethod] public void my_test() { // Arrange …
joelnet
  • 13,621
  • 5
  • 35
  • 49
3
votes
1 answer

unit testing legacy code: limits of "extract and override" vs JustMock/TypeMock/moles?

Given the following conditions: a very old, big, C# legacy code base with no testcoverage whatsoever (almost) every class derives from some interface nothing is sealed What are the practical benefits of using profiler-API-driven solutions like…
hko
  • 923
  • 9
  • 17
1
2 3 4 5 6 7