justmock

TestFixtureSetUpAttribute not found in JustMock?

本秂侑毒 提交于 2020-01-04 04:10:19
问题 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<ProductionOrder> _proOrdRepository = Mock.Create<IGenericRepository<ProductionOrder>>(); I get the following exception: System.TypeInitializationException occurred HResult=0x80131534 Message=An exception occurred in the type initializer of 'Telerik.JustMock.Core.Context.MockingContext'. Source=Telerik.JustMock StackTrace: at Telerik.JustMock.Core.Context

Problems in creating unit test for ASP .NET MVC

做~自己de王妃 提交于 2019-12-17 21:09:28
问题 I am creating some unit tests for my ASP .NET MVC Controller class and I ran into some very strange errors: My controller code is below: [HttpPost] [ValidateAntiForgeryToken] public ActionResult Delete(JournalViewModel journal) { var selectedJournal = Mapper.Map<JournalViewModel, Journal>(journal); var opStatus = _journalRepository.DeleteJournal(selectedJournal); if (!opStatus.Status) throw new System.Web.Http.HttpResponseException(new HttpResponseMessage(HttpStatusCode.NotFound)); return

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

无人久伴 提交于 2019-12-12 15:04:38
问题 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 JustMock and TypeMock, compared to using extract&override + e.g. RhinoMocks? Are there cases I'm not aware of, besides circumventing private/protected, where using TypeMock/JustMock etc. is really needed ? I'd especially welcome some experience from

TypeMock VS JustMock (VS RhinoMock,Moq…): current situation in 2011? [closed]

你离开我真会死。 提交于 2019-12-06 20:18:41
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 29 days ago . 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 isolation thanks to a profiler.

TypeMock VS JustMock (VS RhinoMock,Moq…): current situation in 2011? [closed]

末鹿安然 提交于 2019-12-05 01:39:01
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 isolation thanks to a profiler. From what I read, I have 3 choices: TypeMock Isolator, very powerful but also very expensive http://www.typemock.com/ JustMock of Telerik, the alternative to TypeMock which aims to be TypeMock, but the beta was full of bugs http://www.telerik.com/products/mocking.aspx Moles from Microsoft Pex, the only free solution for

Rhino mock vs Typemock vs JustMock vs [closed]

萝らか妹 提交于 2019-12-03 03:10:09
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 7 years ago . I need to choose mock framework to new project. What are the pros and cons for those frameworks? Any comparison table? I know that

Rhino mock vs Typemock vs JustMock vs [closed]

瘦欲@ 提交于 2019-12-02 16:39:50
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? Dror Helper Before there was JustMock this question was asked and the answers can be found here . There is a very good Mocking framework comparison - it doesn't have JustMock yet but you get to see the syntax and capabilities of each .NET mocking framework. RhinoMocks (and Moq ) are both open source free to use projects that can create fake objects by

Problems in creating unit test for ASP .NET MVC

被刻印的时光 ゝ 提交于 2019-11-28 14:10:36
I am creating some unit tests for my ASP .NET MVC Controller class and I ran into some very strange errors: My controller code is below: [HttpPost] [ValidateAntiForgeryToken] public ActionResult Delete(JournalViewModel journal) { var selectedJournal = Mapper.Map<JournalViewModel, Journal>(journal); var opStatus = _journalRepository.DeleteJournal(selectedJournal); if (!opStatus.Status) throw new System.Web.Http.HttpResponseException(new HttpResponseMessage(HttpStatusCode.NotFound)); return RedirectToAction("Index"); } My test code is below: [TestMethod] public void Delete_Journal() { // Arrange