###前提・実現したいこと
テストファーストで、文字列の比較をしたいのだが、C++になれてなくてエラーが出てしまったので質問しました。
###発生している問題・エラーメッセージ
インスタンスが引数リストと一致しない
###該当のソースコード
.h
C++
1#pragma once 2#include <string> 3 4using namespace std; 5 6class user_test { 7public: 8 user_test( ); 9 ~user_test( ); 10public: 11 int user_set( ); 12 string user_out( ); 13 14}; 15 16
単体テスト
C++
1#include "stdafx.h" 2#include "CppUnitTest.h" 3#include "smart_ptr.h" 4#include <string> 5#include "C:\Users\student\Desktop\jankendemo\test\demo\user_test.h" 6 7using namespace Microsoft::VisualStudio::CppUnitTestFramework; 8using namespace std; 9 10PTR( user_test ); 11 12namespace UnitTest1 13{ 14 TEST_CLASS ( UnitTest1 ) { 15 public: 16 17 TEST_METHOD (set_test); 18 19 }; 20 inline void UnitTest1::set_test() { 21 std::shared_ptr< user_test > test = std::shared_ptr< user_test >( new user_test ); 22 const int NUM = 0; 23 const string CHECK = "rock"; 24 // TODO: テスト コードをここに挿入します 25 if ( NUM == test->user_set( ) ) { 26 ここでエラー -> Assert::AreEqual( CHECK, test->user_out( ), true); 27 } 28 } 29}
###試したこと
文字セットの変更
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2017/11/26 00:32 編集