Permalink
Cannot retrieve contributors at this time
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?
ALL-Project-Second-Semester-Year-1/unitTesting.cpp
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
48 lines (40 sloc)
2.17 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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!"); | |
} | |
} | |