#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());
}
};
}