isolation-frameworks

Which is the best isolation framework for Java? JMock, Easymock, Mockito, or other?

こ雲淡風輕ζ 提交于 2019-12-10 13:06:04
问题 I realize this has been asked before, but the last time was in mid 2008. If you were starting a new project right now, which one would you use and why? What are their strengths/weaknesses regarding readability, usability, maintainability, and overall robustness? 回答1: I have used Easymock earlier, but now I'm using Mockito. I found Mockito simpler as compared to Easymock. For the detailed comparison of Easymock and Mockito you can refer here 回答2: To explain our motivation, jMock is an

Has anyone made moles work properly?

我与影子孤独终老i 提交于 2019-12-07 22:30:28
问题 I was trying to find a consistent description on how to use moles isolation framework but haven't found much on this topic. So far i did the following: Download moles from here (x86 version). Install it. Here guy describes how to use it with custom library. So i added moles assembly for my own library. After rebuild the assembly appeared in references. Then i tried to add using of .Moles namespace and build the project but it failed with bunch of errors. Example with MDateTime didn't work

Has anyone made moles work properly?

℡╲_俬逩灬. 提交于 2019-12-06 11:40:09
I was trying to find a consistent description on how to use moles isolation framework but haven't found much on this topic. So far i did the following: Download moles from here (x86 version). Install it. Here guy describes how to use it with custom library. So i added moles assembly for my own library. After rebuild the assembly appeared in references. Then i tried to add using of .Moles namespace and build the project but it failed with bunch of errors. Example with MDateTime didn't work either. MDateTime just didn't have any method. Considering that was 5th failed attempt to get it work i

How Moles Isolation framework is implemented?

大憨熊 提交于 2019-11-27 11:49:49
Moles is an isolation framework created by Microsoft. A cool feature of Moles is that it can "mock" static/non-virtual methods and sealed classes (which is not possible with frameworks like Moq). Below is the quick demonstration of what Moles can do: Assert.AreNotEqual(new DateTime(2012, 1, 1), DateTime.Now); // MDateTime is part of Moles; the below will "override" DateTime.Now's behavior MDateTime.NowGet = () => new DateTime(2012, 1, 1); Assert.AreEqual(new DateTime(2012, 1, 1), DateTime.Now); Seems like Moles is able to modify the CIL body of things like DateTime.Now at runtime. Since Moles

How Moles Isolation framework is implemented?

我的未来我决定 提交于 2019-11-26 15:46:58
问题 Moles is an isolation framework created by Microsoft. A cool feature of Moles is that it can "mock" static/non-virtual methods and sealed classes (which is not possible with frameworks like Moq). Below is the quick demonstration of what Moles can do: Assert.AreNotEqual(new DateTime(2012, 1, 1), DateTime.Now); // MDateTime is part of Moles; the below will "override" DateTime.Now's behavior MDateTime.NowGet = () => new DateTime(2012, 1, 1); Assert.AreEqual(new DateTime(2012, 1, 1), DateTime.Now