Want to get started unit testing in C++? In this webinar, Gil Zilberfeld discusses the first steps of how to unit test in C++ and how Typemock Isolator can help this process. Unit Testing First Steps in C++ from Gil Zilberfeld on Vimeo.
Tag Archive: C++
Feb
02
Permanent link to this article: http://www.typemock.com/blog/2011/02/02/unit-testing-in-c/
Jan
19
Free Typemock Webinar: Starting Unit Testing in C++ with Isolator++
Next Wednesday, January 26th, we’re going to have our monthly Typemock webinar. This time, we’ve moved the webinar a bit later, to 4pm CET/ 10am EST. In this webinar, Gil Zilberfeld will guide you through the setup needed to write unit tests in C++. We’ll walk through different scenarios that happen in existing code, where …
Permanent link to this article: http://www.typemock.com/blog/2011/01/19/free-typemock-webinar-starting-unit-testing-in-c-with-isolator/
Dec
30
Isolator++ 1.1 Released
Time for another release, And this one, has a few power punches. With the newly Introduced RET macro, Isolator can now fake a ref argument, actually returning it as the method returns. So if you have this method to test: bool PricingManager::IsExpired(){ SYSTEMTIME now; ::GetSystemTime(&now); if (now.wYear > 2010) return true; return false;} And that GetSystemTime needs …
Permanent link to this article: http://www.typemock.com/blog/2010/12/30/isolator-1-1-released/
Dec
28
How To: Fake an Abstract Class with Isolator++
When you declare an abstract class in C++, it looks like this: class AbstractClass { public: virtual int ReturnFive() = 0; }; in Microsoft’s world you have an additional choice – declare a pure virtual method using the PURE macro (basically equivalent): class AbstractClass { public: virtual int ReturnFive() PURE; }; Here are …
Permanent link to this article: http://www.typemock.com/blog/2010/12/28/how-to-fake-an-abstract-class-with-isolator/
Oct
25
How-To: Running Custom Code With DoMemberFunctionInstead Clauses Using Isolator++
Isolator++ APIs make it easy to return custom values or objects. It’s really easy to return values or control behavior of one or more methods. But sometimes you want more than that: You want to run your own code when a method gets called. You want to call a supplied method, change a static flag’s …
Permanent link to this article: http://www.typemock.com/blog/2010/10/25/how-to-running-custom-code-with-domemberfunctioninstead-clauses-using-isolator/
Permanent link to this article: http://www.typemock.com/blog/2010/10/24/video-slides-%e2%80%93-easier-unit-testing-with-isolator/
Oct
20
How-To: Setting Behavior for Future Objects with Isolator++
One of the biggest hurdles in writing tests for legacy code are future dependencies. They are called “future” objects, because they are created inside the class under test, rather then injected into it by the test. Let’s look at our Person constructor: Person::Person() { address = new Address(); } That address, right there, is …
Permanent link to this article: http://www.typemock.com/blog/2010/10/20/how-to-setting-behavior-for-future-objects-with-isolator/
Oct
13
How-To: Faking Private Methods with Isolator++
In many cases, the dependency we’re trying to get around is not in another class, but in the one we’re trying to test. To make things worse, this method is sometimes inaccessible. When that happens, we need to fake the private method, leaving the rest of the object intact. And we can do this easily …
Permanent link to this article: http://www.typemock.com/blog/2010/10/13/how-to-faking-private-methods-with-isolator/
Oct
11
How-To: Asserting A Method Was Called With Isolator++
Many times, when we come to determine a test pass/fail criterion, we use some sort of ASSERT statement. ASSERT usually tests for state – checking on field values, to determine if that value is the expected one. However, sometimes we don’t have this luxury. The state may not be exposed, or the class members are …
Permanent link to this article: http://www.typemock.com/blog/2010/10/11/how-to-asserting-a-method-was-called-with-isolator/
Oct
10
How-To: Change Behavior of Instance Methods with Isolator++
The basis of the Isolator++ is the ability to change behavior of any method. Let’s look at an example for changing behavior of an instance method. We want to test our Person object. While I’m using Person’s method to get the resulting country: char* Person::GetCountry() { return address->GetCountry(); } I’m actually concentrating on the …
Permanent link to this article: http://www.typemock.com/blog/2010/10/10/how-to-change-behavior-of-instance-methods-with-isolator/
