Tag Archive: HowTo

Sep
01

“Why Too Much Mocking is Bad” and Other Questions

Last webinar, “10 secret unit testing tips” was a blast. There were many questions, some I’ve answered. But then I’ve looked at the clock, and discovered I neglected to answer a few. And since I’m a a man of my word (most of the time), here are the rest of the questions and comments and …

Continue reading »

Permanent link to this article: http://www.typemock.com/blog/2011/09/01/%e2%80%9cwhy-too-much-mocking-is-bad%e2%80%9d-and-other-questions/

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 …

Continue reading »

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 …

Continue reading »

Permanent link to this article: http://www.typemock.com/blog/2010/12/28/how-to-fake-an-abstract-class-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 …

Continue reading »

Permanent link to this article: http://www.typemock.com/blog/2010/10/20/how-to-setting-behavior-for-future-objects-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 …

Continue reading »

Permanent link to this article: http://www.typemock.com/blog/2010/10/10/how-to-change-behavior-of-instance-methods-with-isolator/

Oct
06

Isolator++: Introduction

Isolator++ is the new isolation framework from Typemock. In C++ everything is harder, even unit testing, believe it or not. When people start doing unit tests, they run into the dependency problem. And this is where Isolator++ comes to the rescue. But let’s go back to the beginning. There are a couple of test frameworks …

Continue reading »

Permanent link to this article: http://www.typemock.com/blog/2010/10/06/isolator-introduction/

Aug
26

Debugging the Undebuggable

I bumped up against an interesting problem today. I was trying to write a unit test for our CRM code (I’ll write about my endeavor in a another post). Anyway, I was trying to test a method (a WebMethod, actually) that was inside a class, which was inside an asmx file. Strangely enough, I never …

Continue reading »

Permanent link to this article: http://www.typemock.com/blog/2010/08/26/debugging-the-undebuggable/

Jul
19

Free Unit Testing Webinar on LIDNUG with @Typemock

  I want to quickly tell you about an upcoming live unit testing webinar, featuring Gil Zilberfeld from Typemock, that you may find valuable. Here’s the abstract: Unit Testing in the Wild You know that unit testing is good for you. But the calculator examples that you’ve read are not helpful in the real world. …

Continue reading »

Permanent link to this article: http://www.typemock.com/blog/2010/07/19/free-unit-testing-webinar-on-lidnug-with-typemock/

Feb
05

More from this week Typemock TV

Permanent link to this article: http://www.typemock.com/blog/2010/02/05/more-from-this-week-typemock-tv/

Jan
25

How to run NUnit tests created with VS2010 and .NET 4

Today when writing tests for a new project built using VS2010 I had an interesting problem: NUnit would not run my unit tests because the assembly that contained my unit tests was compiled using a newer version of the .NET runtime. There are several solutions to solve this issue from downgrading my project to use …

Continue reading »

Permanent link to this article: http://www.typemock.com/blog/2010/01/25/how-to-run-nunit-tests-created-with-vs2010-and-net-4/

Older posts «