vendredi 20 février 2015

How to do unit test for this?

how do i create a unit test for a function like this?



void TextBuddy::addSentence(char *argv[]){

file.push_back(content);
updateFile(argv);
sprintf_s(message, ADD_MSG.c_str(), argv[1], content.c_str());
output(message);

return;


i'm unable to create a unit test for this function even after trying many many times...



namespace Tester
{
TEST_CLASS(UnitTest)
{
public:
Textbuddy test;
TEST_METHOD(addtest)
{
test.addSentence("hello")
std::string result = "hello";
Assert::AreEqual("hello",result);

Aucun commentaire:

Enregistrer un commentaire