chevron-thin-right chevron-thin-left brand cancel-circle search youtube-icon google-plus-icon linkedin-icon facebook-icon twitter-icon toolbox download check linkedin phone twitter-old google-plus facebook profile-male chat calendar profile-male
0 votes
#include \"stdafx.h\"

#include \"CppUnitTest.h\"

#include \"isolator.h\"

using namespace Microsoft::VisualStudio::CppUnitTestFramework;

namespace MyTests

{

class Person

{

public:

char* Person::GetName()

{

    throw;

}

bool Person::Ping()

{

    return CanPing(true);

}

 

bool Person::CanPing()

{

    throw;

}

 

bool Person::CanPing(bool force)

{

    throw;

}

};

TEST_CLASS(UnitTest1)

{

public:

TEST_METHOD(AssertingACall)

{

Person person;

WHEN_CALLED(person.GetName()).Return(\"Jerry\");

ASSERT_WAS_CALLED(person.GetName());

Assert::AreEqual(\"Jerry\", person.GetName());

}

};

}
asked by dwightbarker (600 points)

1 Answer

0 votes

Hi Dwight,

Thank you for reaching out, as we can see you opened a ticket in our ticket portal.

Therefore, we will continue the treatment there.

Cheers,

Alon Sapozhinkov.

answered by Alon_TypeMock (9k points)
...