Click here to Skip to main content
15,887,267 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
so here I've been trying to do this small manual testing task . i have created a class of teacher and it has a function that creates a student record and rewrites it in its specific position in the file (using linked list). i have a separate header file that has all functions in it and .cpp file separate too. but when i try to test a simple function that either on pressing ch = 1 does function create_node runs or not ? i have no idea which assert to use ? any one can figure out what the issue or is this something wrong with my testing code ? and 'm very very beginner to this testing thing . if anyone could help me with tutorial for manual testing that would be appreciated too .

What I have tried:

#include "stdafx.h"
#include "CppUnitTest.h"
#include "Header.h"
#include <string>

using namespace Microsoft::VisualStudio::CppUnitTestFramework;

namespace UnitTest1
{		
	TEST_CLASS(UnitTest1)
	{
	public:

		TEST_METHOD(TestMethod1)
		{
			string T_name;
			string subject;
			int age;
			int Class_teacher;
			int ch=0;
			teacher T;
			Assert::IsTrue(ch = 1, T.create_node(T_name, subject, Class_teacher, age));

		};
	};
}
Posted
Updated 23-Nov-18 4:35am
Comments
KarstenK 23-Nov-18 12:19pm    
You have bug in the comparison. You need "==" in Assert::IsTrue(ch == 1,

1 solution

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900