I am working on a corporate application, which largely depends on message queues, com +, databases, httpcontext, static utility classes, etc.
Since in our system 600 projects it is not practical to rewrite in order to use the inversion of control. Typemock claims that they are the only isolation environment that does not require you to rewrite your code to use IOC .
Does anyone know how TypeMock implemented this level of functionality and are there any alternatives? Even if I had to rewrite my application to use control inversion, I would have to write wrapper classes for message queues, httpcontext, etc. It just sounds funny to me, right or wrong, to think that Typemock is the only viable option for my scenario.
thanks
You are right to think that TypeMock (or another similar tool for bullying) is the only viable option.
, , , , , .
Java JMockit - .
JMockit , API java.lang.instrument. , / . , -, /, . . , (.. , , -, , JVM).
java.lang.instrument
#
, - . , /.
.
( , ...), Aspect weaver : http://csharp-source.net/open-source/aspect-oriented-frameworks
:
public class MotherClass { private SubClass _subClass; public MotherClass() { _subClass = new SubClass(); } } public class SubClass { public string SomeMethod() { return "Hello"; } }
IoC. Typemock Isolator :
[TestMethod] public void TestMethod() { var fake = Isolate.Fake.Instance<SubClass>(); Isolate.Swap.NextInstance<SubClass>().With(fake); }
SomeMethod :
var fake = Isolate.Fake.Instance<SubClass>(); Isolate.WhenCalled(() => fake.SomeMethod()).WillReturn("Bye");
IOC. , . , , , ( , ), . - . , .
. . , . , ( EasyMock, , - JMock, Mockito). -, -. , ( , ).
(Aspect Oriented, , Typemock) , . , ( ), - .
, , Groovy. Groovy Java ( -) . Google Groovy .
Source: https://habr.com/ru/post/1712614/More articles:Python object has no references, but accessible via weakref? - pythonDownload Silverlight Ftp - apacheGetting the correctness of "this" in a jQuery button callback - javascripthttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1712612/matlab-converting-a-vector-of-values-to-uint32&usg=ALkJrhhCnSMWAINJQXcOj0RKD_y7bZAZcgHow to convert LPWSTR to GUID? - c ++Problem using jQuery to animate divs up to 100% height - jqueryУдалить строку в определенном номере строки в Postgres - sqlChoosing excel java api - javaparsing unknown element attributes in XML file using jquery - jqueryUnit Testing Asp.net MVC Controller Activity - unit-testingAll Articles