Skip to content
Permalink
1fe355162b
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
48 lines (40 sloc) 2.17 KB
#define CATCH_CONFIG_MAIN;
#include <catch.hpp>
#include "Sudoku.h"
TEST_CASE( "Unacceptable Inputs" )
{
WHEN( "All lowercase" )
{
REQUIRE( kindaMainFunctionButNotQuite() );
REQUIRE( kindaMainFunctionButNotQuite("0","-9") == "Please enter a valid row!" );
REQUIRE( kindaMainFunctionButNotQuite("-69","-69") == "Please enter a valid column!" );
REQUIRE( kindaMainFunctionButNotQuite("9","9") == "Please enter a valid column!" );
REQUIRE( kindaMainFunctionButNotQuite("37","87") == "Please enter a valid column!" );
REQUIRE( kindaMainFunctionButNotQuite("69","69") == "Please enter a valid column!" );
}
TEST_CASE( "Place Already Taken" )
{
WHEN( "All lowercase" )
{
REQUIRE( kindaMainFunctionButNotQuite() );
REQUIRE( kindaMainFunctionButNotQuite("0","-9") == "Wrong cell! This cell has number in it already. Plaese try again:" );
REQUIRE( kindaMainFunctionButNotQuite("-69","-69") == "Wrong cell! This cell has number in it already. Plaese try again:" );
REQUIRE( kindaMainFunctionButNotQuite("9","9") == "Wrong cell! This cell has number in it already. Plaese try again:")
REQUIRE( kindaMainFunctionButNotQuite("0","0")== "Wrong cell! This cell has number in it already. Please try again:");
}
}
TEST_CASE( "Unacceptable Number" )
{
WHEN( "All lowercase" )
{
REQUIRE( kindaMainFunctionButNotQuite() );
REQUIRE( kindaMainFunctionButNotQuite("0","0","0") == "Please enter a valid number!" );
REQUIRE( kindaMainFunctionButNotQuite("0","0","10") == "Please enter a valid number!" );
REQUIRE( kindaMainFunctionButNotQuite("0","0","9.5") == "Please enter a valid number!")
REQUIRE( kindaMainFunctionButNotQuite("0","0","1.5")== "Please enter a valid number!");
REQUIRE( kindaMainFunctionButNotQuite("0","0","8.9")== "Please enter a valid number!");
REQUIRE( kindaMainFunctionButNotQuite("0","0","-1.5")== "Please enter a valid number!");
REQUIRE( kindaMainFunctionButNotQuite("0","0","-6")== "Please enter a valid number!");
REQUIRE( kindaMainFunctionButNotQuite("0","0","-15")== "Please enter a valid number!");
}
}