From 2f66a59bec4b54e39e30d4beba01e135da7de29b Mon Sep 17 00:00:00 2001 From: HanHan Date: Tue, 30 Jun 2020 15:11:18 +0200 Subject: [PATCH 1/8] Setup codecov --- .travis.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.travis.yml b/.travis.yml index 98ff2b1..a113467 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,10 +6,15 @@ jobs: solution: Validator.sln before_script: - cd Validator + install: + - pip install coverage script: - dotnet restore - dotnet build - dotnet test + - coverage run -m unittest discover + after_success: + - bash <(curl -s https://codecov.io/bash) - language: objective-c osx_image: xcode11.2 From abe99c59526e15c38caba216aa0e596072f69be0 Mon Sep 17 00:00:00 2001 From: HanHan Date: Tue, 30 Jun 2020 15:15:01 +0200 Subject: [PATCH 2/8] fix pip install line --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index a113467..2040be1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,7 +7,7 @@ jobs: before_script: - cd Validator install: - - pip install coverage + - pip install coverage --user script: - dotnet restore - dotnet build From c310ac219d31d1fb1aef658a3d36bf73d425defd Mon Sep 17 00:00:00 2001 From: HanHan Date: Tue, 30 Jun 2020 15:34:27 +0200 Subject: [PATCH 3/8] Added codecov config file --- .travis.yml | 5 ----- appveyor.yml | 14 ++++++++++++++ 2 files changed, 14 insertions(+), 5 deletions(-) create mode 100644 appveyor.yml diff --git a/.travis.yml b/.travis.yml index 2040be1..98ff2b1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,15 +6,10 @@ jobs: solution: Validator.sln before_script: - cd Validator - install: - - pip install coverage --user script: - dotnet restore - dotnet build - dotnet test - - coverage run -m unittest discover - after_success: - - bash <(curl -s https://codecov.io/bash) - language: objective-c osx_image: xcode11.2 diff --git a/appveyor.yml b/appveyor.yml new file mode 100644 index 0000000..1b6536f --- /dev/null +++ b/appveyor.yml @@ -0,0 +1,14 @@ +image: Visual Studio 2017 + +before_build: +- nuget restore +- choco install opencover.portable +- choco install codecov + +build: + project: Validator\Validator.sln + verbosity: minimal + +test_script: +- OpenCover.Console.exe -register:user -target:"%xunit20%\xunit.console.x86.exe" -targetargs:".\UnitTests\bin\Debug\netcoreapp2.1\UnitTests.dll -noshadow" -filter:"+[Validator*]* -[UnitTests*]*" -output:".\Validator_Coverage.xml" +- codecov -f "Validator_Coverage.xml" \ No newline at end of file From c6026e23dc73cd4e77839d301c3c58774d7f91b0 Mon Sep 17 00:00:00 2001 From: HanHan Date: Tue, 30 Jun 2020 15:55:42 +0200 Subject: [PATCH 4/8] Changed travis config file codecov --- .travis.yml | 5 ++++- appveyor.yml | 14 -------------- 2 files changed, 4 insertions(+), 15 deletions(-) delete mode 100644 appveyor.yml diff --git a/.travis.yml b/.travis.yml index 98ff2b1..0cd1030 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,7 +9,10 @@ jobs: script: - dotnet restore - dotnet build - - dotnet test + - choco install opencover.portable + - choco install codecov + - OpenCover.Console.exe -register:user -target:"%xunit20%\xunit.console.x86.exe" -targetargs:".\UnitTests\bin\Debug\netcoreapp2.1\UnitTests.dll -noshadow" -filter:"+[Validator*]* -[UnitTests*]*" -output:".\Validator_Coverage.xml" + - codecov -f "Validator_Coverage.xml" - language: objective-c osx_image: xcode11.2 diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index 1b6536f..0000000 --- a/appveyor.yml +++ /dev/null @@ -1,14 +0,0 @@ -image: Visual Studio 2017 - -before_build: -- nuget restore -- choco install opencover.portable -- choco install codecov - -build: - project: Validator\Validator.sln - verbosity: minimal - -test_script: -- OpenCover.Console.exe -register:user -target:"%xunit20%\xunit.console.x86.exe" -targetargs:".\UnitTests\bin\Debug\netcoreapp2.1\UnitTests.dll -noshadow" -filter:"+[Validator*]* -[UnitTests*]*" -output:".\Validator_Coverage.xml" -- codecov -f "Validator_Coverage.xml" \ No newline at end of file From bd5df1fba059acc5f31fd0ed052122a76a0b718b Mon Sep 17 00:00:00 2001 From: HanHan Date: Tue, 30 Jun 2020 16:10:54 +0200 Subject: [PATCH 5/8] New Unity build --- .travis.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 0cd1030..868e357 100644 --- a/.travis.yml +++ b/.travis.yml @@ -25,6 +25,4 @@ jobs: install: - bash <(curl -fsSL https://raw.githubusercontent.com/neogeek/unity-ci-tools/v1.0.0/bin/install.sh) script: - - bash <(curl -fsSL https://raw.githubusercontent.com/neogeek/unity-ci-tools/v1.0.0/bin/auth.sh) - - bash <(curl -fsSL https://raw.githubusercontent.com/neogeek/unity-ci-tools/v1.0.0/bin/test.sh) - - bash <(curl -fsSL https://raw.githubusercontent.com/neogeek/unity-ci-tools/v1.0.0/bin/deauth.sh) \ No newline at end of file + - bash <(curl -fsSL https://raw.githubusercontent.com/neogeek/unity-ci-tools/v1.0.0/bin/test.sh) \ No newline at end of file From 75ba6a1eca7e317a300474d180ed3c26f873f6e6 Mon Sep 17 00:00:00 2001 From: HanHan Date: Tue, 30 Jun 2020 16:42:02 +0200 Subject: [PATCH 6/8] new unity build config --- .travis.yml | 44 +++++++++++++++++---- travis-build/build.sh | 37 ++++++++++++++++++ travis-build/export-unity-package.sh | 57 ++++++++++++++++++++++++++++ travis-build/install-unity.sh | 42 ++++++++++++++++++++ travis-build/run-tests.sh | 4 ++ 5 files changed, 176 insertions(+), 8 deletions(-) create mode 100644 travis-build/build.sh create mode 100644 travis-build/export-unity-package.sh create mode 100644 travis-build/install-unity.sh create mode 100644 travis-build/run-tests.sh diff --git a/.travis.yml b/.travis.yml index 868e357..efca453 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,14 +15,42 @@ jobs: - codecov -f "Validator_Coverage.xml" - language: objective-c - osx_image: xcode11.2 + osx_image: xcode9.2 + rvm: + - 2.2 #see before_install for getting RVM stable. + + env: + - TRAVIS_TAG="Deploy-main" PROJECT_NAME="BivalenceWorld" UNITY_PROJECT_PATH="BivalenceWorld" DEPLOY_UNITYPACKAGE="path set in deploy script" + + cache: - timeout: 86400 # 1 day - directories: - - $HOME/cache/ - before_script: - - cd GUI + directories: + - $UNITY_DOWNLOAD_CACHE + + + before_install: + - chmod a+x ./travis-build/*.sh + install: - - bash <(curl -fsSL https://raw.githubusercontent.com/neogeek/unity-ci-tools/v1.0.0/bin/install.sh) + - cat /etc/hosts + - ./travis-build/install-unity.sh + script: - - bash <(curl -fsSL https://raw.githubusercontent.com/neogeek/unity-ci-tools/v1.0.0/bin/test.sh) \ No newline at end of file + - ./travis-build/build.sh + - ./travis-build/run-tests.sh + + after_success: + - ./travis-build/export-unity-package.sh + + before_deploy: + - DEPLOY_UNITYPACKAGE="$(ls -a release/*.zip | head -n 1)" + + deploy: + provider: releases + api_key: $GITHUB_TOKEN + file: $DEPLOY_UNITYPACKAGE + skip_cleanup: true + overwrite: true + on: + tags: true + \ No newline at end of file diff --git a/travis-build/build.sh b/travis-build/build.sh new file mode 100644 index 0000000..7a94ad4 --- /dev/null +++ b/travis-build/build.sh @@ -0,0 +1,37 @@ +#! /bin/sh + +PROJECT_PATH=$(pwd)/$UNITY_PROJECT_PATH +UNITY_BUILD_DIR=$(pwd)/Build +LOG_FILE=$UNITY_BUILD_DIR/unity-win.log + + +ERROR_CODE=0 +echo "Items in project path ($PROJECT_PATH):" +ls "$PROJECT_PATH" + + +echo "Building project for Windows..." +mkdir $UNITY_BUILD_DIR +/Applications/Unity/Unity.app/Contents/MacOS/Unity \ + -batchmode \ + -nographics \ + -silent-crashes \ + -logFile \ + -projectPath "$PROJECT_PATH" \ + -buildWindows64Player "$(pwd)/build/win/ci-build.exe" \ + -quit \ + | tee "$LOG_FILE" + +if [ $? = 0 ] ; then + echo "Building Windows exe completed successfully." + ERROR_CODE=0 +else + echo "Building Windows exe failed. Exited with $?." + ERROR_CODE=1 +fi + +#echo 'Build logs:' +#cat $LOG_FILE + +echo "Finishing with code $ERROR_CODE" +exit $ERROR_CODE \ No newline at end of file diff --git a/travis-build/export-unity-package.sh b/travis-build/export-unity-package.sh new file mode 100644 index 0000000..3012c61 --- /dev/null +++ b/travis-build/export-unity-package.sh @@ -0,0 +1,57 @@ +#! /bin/sh + +PROJECT_PATH=$(pwd)/$UNITY_PROJECT_PATH +UNITY_BUILD_DIR=$(pwd)/Build +LOG_FILE=$UNITY_BUILD_DIR/unity-win.log +EXPORT_PATH=$(pwd)/$PROJECT_NAME-v"$TRAVIS_TAG"-b"$TRAVIS_BUILD_NUMBER".unitypackage +RELEASE_DIRECTORY=./release + + +ERROR_CODE=0 + +echo "Creating package at=$EXPORT_PATH" +mkdir $UNITY_BUILD_DIR +/Applications/Unity/Unity.app/Contents/MacOS/Unity \ + -batchmode \ + -nographics \ + -silent-crashes \ + -logFile \ + -projectPath "$PROJECT_PATH" \ + -exportPackage "Assets" "$EXPORT_PATH" \ + -quit \ + | tee "$LOG_FILE" + +if [ $? = 0 ] ; then + echo "Created package successfully." + ERROR_CODE=0 + + echo "Packaging unity package into release..." + #Preprare release unity package by packing into ZIP + RELEASE_ZIP_FILE=$RELEASE_DIRECTORY/$PROJECT_NAME-v$TRAVIS_TAG.zip + + mkdir -p $RELEASE_DIRECTORY + + echo "Preparing release for version: $TRAVIS_TAG" + cp "$EXPORT_PATH" "$RELEASE_DIRECTORY/"`basename "$EXPORT_PATH"` + cp "./README.md" "$RELEASE_DIRECTORY" + cp "./LICENSE" "$RELEASE_DIRECTORY" + + echo "Files in release directory:" + ls $RELEASE_DIRECTORY + + zip -6 -r $RELEASE_ZIP_FILE $RELEASE_DIRECTORY + + echo "Release zip package ready. Zipinfo:" + zipinfo $RELEASE_ZIP_FILE + +else + echo "Creating package failed. Exited with $?." + ls + ERROR_CODE=1 +fi + +#echo 'Build logs:' +#cat $LOG_FILE + +echo "Export finished with code $ERROR_CODE" +exit $ERROR_CODE diff --git a/travis-build/install-unity.sh b/travis-build/install-unity.sh new file mode 100644 index 0000000..0c04d7a --- /dev/null +++ b/travis-build/install-unity.sh @@ -0,0 +1,42 @@ +#! /bin/sh + +# See https://unity3d.com/get-unity/download/archive +# to get download URLs +UNITY_DOWNLOAD_CACHE="$(pwd)/unity_download_cache" +UNITY_OSX_PACKAGE_URL="https://download.unity3d.com/download_unity/27ab2135bccf/MacEditorInstaller/Unity-2019.3.0f6.pkg" +UNITY_WINDOWS_TARGET_PACKAGE_URL="https://download.unity3d.com/download_unity/27ab2135bccf/MacEditorTargetInstaller/UnitySetup-Windows-Mono-Support-for-Editor-2019.3.0f6.pkg" + + +# Downloads a file if it does not exist +download() { + + URL=$1 + FILE=`basename "$URL"` + + # Downloads a package if it does not already exist in cache + if [ ! -e $UNITY_DOWNLOAD_CACHE/`basename "$URL"` ] ; then + echo "$FILE does not exist. Downloading from $URL: " + mkdir -p "$UNITY_DOWNLOAD_CACHE" + curl -o $UNITY_DOWNLOAD_CACHE/`basename "$URL"` "$URL" + else + echo "$FILE Exists. Skipping download." + fi +} + +# Downloads and installs a package from an internet URL +install() { + PACKAGE_URL=$1 + download $1 + + echo "Installing `basename "$PACKAGE_URL"`" + sudo installer -dumplog -package $UNITY_DOWNLOAD_CACHE/`basename "$PACKAGE_URL"` -target / +} + + + +echo "Contents of Unity Download Cache:" +ls $UNITY_DOWNLOAD_CACHE + +echo "Installing Unity..." +install $UNITY_OSX_PACKAGE_URL +install $UNITY_WINDOWS_TARGET_PACKAGE_URL diff --git a/travis-build/run-tests.sh b/travis-build/run-tests.sh new file mode 100644 index 0000000..fca1580 --- /dev/null +++ b/travis-build/run-tests.sh @@ -0,0 +1,4 @@ +#! /bin/sh + +echo "Skipping testing. No Tests implemented yet..." +exit 0 \ No newline at end of file From e3f4239c1c1257d81b69c1e4d2680b72a9651324 Mon Sep 17 00:00:00 2001 From: HanHan Date: Wed, 15 Jul 2020 12:13:29 +0200 Subject: [PATCH 7/8] Renaming to bivalenceWorld --- .../BivalenceWorld.cs | 89 +++++++++++++++++++ ...aFields.cs => BivalenceWorldDataFields.cs} | 2 +- .../Predicates/Larger.cs | 6 +- .../Predicates/SameShape.cs | 6 +- .../Predicates/SameSize.cs | 6 +- .../Predicates/Smaller.cs | 6 +- .../BivalenceWorldStructures/TarskiWorld.cs | 89 ------------------- ... Test_BivalenceWorld_EValidationResult.cs} | 6 +- ...quals.cs => Test_BivalenceWorld_Equals.cs} | 18 ++-- ...ns.cs => Test_BivalenceWorld_Functions.cs} | 10 +-- ....cs => Test_BivalenceWorld_Implication.cs} | 10 +-- ...> Test_BivalenceWorld_IntegrationTests.cs} | 50 +++++------ ...ion.cs => Test_BivalenceWorld_Negation.cs} | 10 +-- ....cs => Test_BivalenceWorld_Parantheses.cs} | 38 ++++---- ...sing.cs => Test_BivalenceWorld_Parsing.cs} | 20 ++--- ...te.cs => Test_BivalenceWorld_Predicate.cs} | 60 ++++++------- ...ntum.cs => Test_BivalenceWorld_Quantum.cs} | 18 ++-- .../UnitTests/Test_PL1_ConstPred_Constant.cs | 32 +++---- Validator/UnitTests/Test_PL1_DynamicPred.cs | 16 ++-- 19 files changed, 246 insertions(+), 246 deletions(-) create mode 100644 Validator/BivalenceWorld/BivalenceWorldStructures/BivalenceWorld.cs rename Validator/BivalenceWorld/BivalenceWorldStructures/{TarskiWorldDataFields.cs => BivalenceWorldDataFields.cs} (95%) delete mode 100644 Validator/BivalenceWorld/BivalenceWorldStructures/TarskiWorld.cs rename Validator/UnitTests/{Test_TarskiWorld_EValidationResult.cs => Test_BivalenceWorld_EValidationResult.cs} (93%) rename Validator/UnitTests/{Test_TarskiWorld_Equals.cs => Test_BivalenceWorld_Equals.cs} (72%) rename Validator/UnitTests/{Test_Tarski_Functions.cs => Test_BivalenceWorld_Functions.cs} (76%) rename Validator/UnitTests/{Test_TarskiWorld_Implication.cs => Test_BivalenceWorld_Implication.cs} (76%) rename Validator/UnitTests/{Test_TarskiWorld_IntegrationTests.cs => Test_BivalenceWorld_IntegrationTests.cs} (72%) rename Validator/UnitTests/{Test_TarskiWorld_Negation.cs => Test_BivalenceWorld_Negation.cs} (75%) rename Validator/UnitTests/{Test_TarskiWorld_Parantheses.cs => Test_BivalenceWorld_Parantheses.cs} (68%) rename Validator/UnitTests/{Test_TarskiWorld_Parsing.cs => Test_BivalenceWorld_Parsing.cs} (89%) rename Validator/UnitTests/{Test_TarskiWorld_Predicate.cs => Test_BivalenceWorld_Predicate.cs} (66%) rename Validator/UnitTests/{Test_TarskiWorld_Quantum.cs => Test_BivalenceWorld_Quantum.cs} (75%) diff --git a/Validator/BivalenceWorld/BivalenceWorldStructures/BivalenceWorld.cs b/Validator/BivalenceWorld/BivalenceWorldStructures/BivalenceWorld.cs new file mode 100644 index 0000000..5d726a4 --- /dev/null +++ b/Validator/BivalenceWorld/BivalenceWorldStructures/BivalenceWorld.cs @@ -0,0 +1,89 @@ +using System.Collections.Generic; + +namespace Validator +{ + public class BivalenceWorld : AWorld + { + protected override Signature CreateSignature() + { + List consts = new List() + { + "a", + "b", + "c", + "d", + "e", + "f", + "u", + "v", + "w", + "x", + "y", + "z" + }; + + List<(string, int)> predicates = new List<(string, int)> + { + (BivalenceWorldDataFields.TET, 1), + (BivalenceWorldDataFields.CUBE, 1), + (BivalenceWorldDataFields.DODEC, 1), + (BivalenceWorldDataFields.SMALL, 1), + (BivalenceWorldDataFields.MEDIUM, 1), + (BivalenceWorldDataFields.LARGE, 1), + (BivalenceWorldDataFields.ADJOINS, 2), + (BivalenceWorldDataFields.BACKOF, 2), + (BivalenceWorldDataFields.FRONTOF, 2), + (BivalenceWorldDataFields.LARGER, 2), + (BivalenceWorldDataFields.LEFTOF, 2), + (BivalenceWorldDataFields.RIGHTOF, 2), + (BivalenceWorldDataFields.SAMECOL, 2), + (BivalenceWorldDataFields.SAMEROW, 2), + (BivalenceWorldDataFields.SAMESHAPE, 2), + (BivalenceWorldDataFields.SAMESIZE, 2), + (BivalenceWorldDataFields.SMALLER, 2), + + (BivalenceWorldDataFields.BETWEEN, 3) + }; + + List<(string, int)> functions = new List<(string, int)> + { + (BivalenceWorldDataFields.FRONTMOST, 1), + (BivalenceWorldDataFields.BACKMOST, 1), + (BivalenceWorldDataFields.RIGHTMOST, 1), + (BivalenceWorldDataFields.LEFTMOST, 1), + }; + + return new Signature(consts, predicates, functions); + } + + protected override Dictionary CreatePredicateDictionary() + { + return new Dictionary + { + { BivalenceWorldDataFields.ADJOINS, new Adjoins() }, + { BivalenceWorldDataFields.BACKOF, new BackOf() }, + { BivalenceWorldDataFields.BETWEEN, new Between() }, + { BivalenceWorldDataFields.FRONTOF, new FrontOf() }, + { BivalenceWorldDataFields.LARGER, new Larger() }, + { BivalenceWorldDataFields.LEFTOF, new LeftOf() }, + { BivalenceWorldDataFields.RIGHTOF, new RightOf() }, + { BivalenceWorldDataFields.SAMECOL, new SameCol() }, + { BivalenceWorldDataFields.SAMEROW, new SameRow() }, + { BivalenceWorldDataFields.SAMESHAPE, new SameShape() }, + { BivalenceWorldDataFields.SAMESIZE, new SameSize() }, + { BivalenceWorldDataFields.SMALLER, new Smaller() }, + }; + } + + protected override Dictionary CreateFunctionDictionary() + { + return new Dictionary() + { + {BivalenceWorldDataFields.BACKMOST, new BackMost() }, + {BivalenceWorldDataFields.LEFTMOST, new LeftMost() }, + {BivalenceWorldDataFields.RIGHTMOST, new RightMost() }, + {BivalenceWorldDataFields.FRONTMOST, new FrontMost() } + }; + } + } +} diff --git a/Validator/BivalenceWorld/BivalenceWorldStructures/TarskiWorldDataFields.cs b/Validator/BivalenceWorld/BivalenceWorldStructures/BivalenceWorldDataFields.cs similarity index 95% rename from Validator/BivalenceWorld/BivalenceWorldStructures/TarskiWorldDataFields.cs rename to Validator/BivalenceWorld/BivalenceWorldStructures/BivalenceWorldDataFields.cs index 863e3c7..7efa219 100644 --- a/Validator/BivalenceWorld/BivalenceWorldStructures/TarskiWorldDataFields.cs +++ b/Validator/BivalenceWorld/BivalenceWorldStructures/BivalenceWorldDataFields.cs @@ -4,7 +4,7 @@ namespace Validator { - public static class TarskiWorldDataFields + public static class BivalenceWorldDataFields { public const string LARGE = "Large"; public const string CUBE = "Cube"; diff --git a/Validator/BivalenceWorld/BivalenceWorldStructures/Predicates/Larger.cs b/Validator/BivalenceWorld/BivalenceWorldStructures/Predicates/Larger.cs index 90bc320..e1d4d28 100644 --- a/Validator/BivalenceWorld/BivalenceWorldStructures/Predicates/Larger.cs +++ b/Validator/BivalenceWorld/BivalenceWorldStructures/Predicates/Larger.cs @@ -17,9 +17,9 @@ public bool Check(List obj) WorldObject obj1 = obj[0]; WorldObject obj2 = obj[1]; - if (obj1.CheckPredicate(obj2, TarskiWorldDataFields.LARGE, TarskiWorldDataFields.MEDIUM) || - obj1.CheckPredicate(obj2, TarskiWorldDataFields.LARGE, TarskiWorldDataFields.SMALL) || - obj1.CheckPredicate(obj2, TarskiWorldDataFields.MEDIUM, TarskiWorldDataFields.SMALL)) + if (obj1.CheckPredicate(obj2, BivalenceWorldDataFields.LARGE, BivalenceWorldDataFields.MEDIUM) || + obj1.CheckPredicate(obj2, BivalenceWorldDataFields.LARGE, BivalenceWorldDataFields.SMALL) || + obj1.CheckPredicate(obj2, BivalenceWorldDataFields.MEDIUM, BivalenceWorldDataFields.SMALL)) { return true; } diff --git a/Validator/BivalenceWorld/BivalenceWorldStructures/Predicates/SameShape.cs b/Validator/BivalenceWorld/BivalenceWorldStructures/Predicates/SameShape.cs index f7229e7..26ce2b9 100644 --- a/Validator/BivalenceWorld/BivalenceWorldStructures/Predicates/SameShape.cs +++ b/Validator/BivalenceWorld/BivalenceWorldStructures/Predicates/SameShape.cs @@ -18,9 +18,9 @@ public bool Check(List obj) WorldObject obj1 = obj[0]; WorldObject obj2 = obj[1]; - if (obj1.CheckPredicate(obj2, TarskiWorldDataFields.CUBE, TarskiWorldDataFields.CUBE) || - obj1.CheckPredicate(obj2, TarskiWorldDataFields.TET, TarskiWorldDataFields.TET) || - obj1.CheckPredicate(obj2, TarskiWorldDataFields.DODEC, TarskiWorldDataFields.DODEC)) + if (obj1.CheckPredicate(obj2, BivalenceWorldDataFields.CUBE, BivalenceWorldDataFields.CUBE) || + obj1.CheckPredicate(obj2, BivalenceWorldDataFields.TET, BivalenceWorldDataFields.TET) || + obj1.CheckPredicate(obj2, BivalenceWorldDataFields.DODEC, BivalenceWorldDataFields.DODEC)) { result = true; } diff --git a/Validator/BivalenceWorld/BivalenceWorldStructures/Predicates/SameSize.cs b/Validator/BivalenceWorld/BivalenceWorldStructures/Predicates/SameSize.cs index f069f4b..840a4e5 100644 --- a/Validator/BivalenceWorld/BivalenceWorldStructures/Predicates/SameSize.cs +++ b/Validator/BivalenceWorld/BivalenceWorldStructures/Predicates/SameSize.cs @@ -18,9 +18,9 @@ public bool Check(List obj) WorldObject obj1 = obj[0]; WorldObject obj2 = obj[1]; - if (obj1.CheckPredicate(obj2, TarskiWorldDataFields.SMALL, TarskiWorldDataFields.SMALL) || - obj1.CheckPredicate(obj2, TarskiWorldDataFields.MEDIUM, TarskiWorldDataFields.MEDIUM) || - obj1.CheckPredicate(obj2, TarskiWorldDataFields.LARGE, TarskiWorldDataFields.LARGE)) + if (obj1.CheckPredicate(obj2, BivalenceWorldDataFields.SMALL, BivalenceWorldDataFields.SMALL) || + obj1.CheckPredicate(obj2, BivalenceWorldDataFields.MEDIUM, BivalenceWorldDataFields.MEDIUM) || + obj1.CheckPredicate(obj2, BivalenceWorldDataFields.LARGE, BivalenceWorldDataFields.LARGE)) { result = true; } diff --git a/Validator/BivalenceWorld/BivalenceWorldStructures/Predicates/Smaller.cs b/Validator/BivalenceWorld/BivalenceWorldStructures/Predicates/Smaller.cs index 2c2e6f0..93763e3 100644 --- a/Validator/BivalenceWorld/BivalenceWorldStructures/Predicates/Smaller.cs +++ b/Validator/BivalenceWorld/BivalenceWorldStructures/Predicates/Smaller.cs @@ -17,9 +17,9 @@ public bool Check(List obj) WorldObject obj1 = obj[0]; WorldObject obj2 = obj[1]; - if (obj1.CheckPredicate(obj2, TarskiWorldDataFields.MEDIUM, TarskiWorldDataFields.LARGE) || - obj1.CheckPredicate(obj2, TarskiWorldDataFields.SMALL, TarskiWorldDataFields.LARGE) || - obj1.CheckPredicate(obj2, TarskiWorldDataFields.SMALL, TarskiWorldDataFields.MEDIUM)) + if (obj1.CheckPredicate(obj2, BivalenceWorldDataFields.MEDIUM, BivalenceWorldDataFields.LARGE) || + obj1.CheckPredicate(obj2, BivalenceWorldDataFields.SMALL, BivalenceWorldDataFields.LARGE) || + obj1.CheckPredicate(obj2, BivalenceWorldDataFields.SMALL, BivalenceWorldDataFields.MEDIUM)) { return true; } diff --git a/Validator/BivalenceWorld/BivalenceWorldStructures/TarskiWorld.cs b/Validator/BivalenceWorld/BivalenceWorldStructures/TarskiWorld.cs deleted file mode 100644 index 5c88a2d..0000000 --- a/Validator/BivalenceWorld/BivalenceWorldStructures/TarskiWorld.cs +++ /dev/null @@ -1,89 +0,0 @@ -using System.Collections.Generic; - -namespace Validator -{ - public class TarskiWorld : AWorld - { - protected override Signature CreateSignature() - { - List consts = new List() - { - "a", - "b", - "c", - "d", - "e", - "f", - "u", - "v", - "w", - "x", - "y", - "z" - }; - - List<(string, int)> predicates = new List<(string, int)> - { - (TarskiWorldDataFields.TET, 1), - (TarskiWorldDataFields.CUBE, 1), - (TarskiWorldDataFields.DODEC, 1), - (TarskiWorldDataFields.SMALL, 1), - (TarskiWorldDataFields.MEDIUM, 1), - (TarskiWorldDataFields.LARGE, 1), - (TarskiWorldDataFields.ADJOINS, 2), - (TarskiWorldDataFields.BACKOF, 2), - (TarskiWorldDataFields.FRONTOF, 2), - (TarskiWorldDataFields.LARGER, 2), - (TarskiWorldDataFields.LEFTOF, 2), - (TarskiWorldDataFields.RIGHTOF, 2), - (TarskiWorldDataFields.SAMECOL, 2), - (TarskiWorldDataFields.SAMEROW, 2), - (TarskiWorldDataFields.SAMESHAPE, 2), - (TarskiWorldDataFields.SAMESIZE, 2), - (TarskiWorldDataFields.SMALLER, 2), - - (TarskiWorldDataFields.BETWEEN, 3) - }; - - List<(string, int)> functions = new List<(string, int)> - { - (TarskiWorldDataFields.FRONTMOST, 1), - (TarskiWorldDataFields.BACKMOST, 1), - (TarskiWorldDataFields.RIGHTMOST, 1), - (TarskiWorldDataFields.LEFTMOST, 1), - }; - - return new Signature(consts, predicates, functions); - } - - protected override Dictionary CreatePredicateDictionary() - { - return new Dictionary - { - { TarskiWorldDataFields.ADJOINS, new Adjoins() }, - { TarskiWorldDataFields.BACKOF, new BackOf() }, - { TarskiWorldDataFields.BETWEEN, new Between() }, - { TarskiWorldDataFields.FRONTOF, new FrontOf() }, - { TarskiWorldDataFields.LARGER, new Larger() }, - { TarskiWorldDataFields.LEFTOF, new LeftOf() }, - { TarskiWorldDataFields.RIGHTOF, new RightOf() }, - { TarskiWorldDataFields.SAMECOL, new SameCol() }, - { TarskiWorldDataFields.SAMEROW, new SameRow() }, - { TarskiWorldDataFields.SAMESHAPE, new SameShape() }, - { TarskiWorldDataFields.SAMESIZE, new SameSize() }, - { TarskiWorldDataFields.SMALLER, new Smaller() }, - }; - } - - protected override Dictionary CreateFunctionDictionary() - { - return new Dictionary() - { - {TarskiWorldDataFields.BACKMOST, new BackMost() }, - {TarskiWorldDataFields.LEFTMOST, new LeftMost() }, - {TarskiWorldDataFields.RIGHTMOST, new RightMost() }, - {TarskiWorldDataFields.FRONTMOST, new FrontMost() } - }; - } - } -} diff --git a/Validator/UnitTests/Test_TarskiWorld_EValidationResult.cs b/Validator/UnitTests/Test_BivalenceWorld_EValidationResult.cs similarity index 93% rename from Validator/UnitTests/Test_TarskiWorld_EValidationResult.cs rename to Validator/UnitTests/Test_BivalenceWorld_EValidationResult.cs index 2542e1f..81636ad 100644 --- a/Validator/UnitTests/Test_TarskiWorld_EValidationResult.cs +++ b/Validator/UnitTests/Test_BivalenceWorld_EValidationResult.cs @@ -7,7 +7,7 @@ namespace UnitTests { [TestClass] - public class Test_TarskiWorld_EValidationResult + public class Test_BivalenceWorld_EValidationResult { private const string AllQuantum = "\u2200"; private const string ExistQuantum = "\u2203"; @@ -28,7 +28,7 @@ public void TarskiWorld_ParserError() new WorldObject(new List() { "a" }, new List() {"Tet"}, new List() ) }; WorldParameter parameter = new WorldParameter(worldObjects, sentences); - TarskiWorld world = new TarskiWorld(); + BivalenceWorld world = new BivalenceWorld(); var result = world.Check(parameter); Assert.IsTrue(result.Result.Value[0].Value == EValidationResult.ParserFailed); Assert.IsTrue(result.Result.Value[1].Value == EValidationResult.ParserFailed); @@ -49,7 +49,7 @@ public void TarskiWorld_CanNotBeValidated() new WorldObject(new List() { "a", "c" }, new List() {"Tet", "Large"}, new List {3,2} ) }; WorldParameter parameter = new WorldParameter(worldObjects, sentences); - TarskiWorld world = new TarskiWorld(); + BivalenceWorld world = new BivalenceWorld(); var result = world.Check(parameter); Assert.IsTrue(result.Result.Value[0].Value == EValidationResult.CanNotBeValidated); Assert.IsTrue(result.Result.Value[1].Value == EValidationResult.CanNotBeValidated); diff --git a/Validator/UnitTests/Test_TarskiWorld_Equals.cs b/Validator/UnitTests/Test_BivalenceWorld_Equals.cs similarity index 72% rename from Validator/UnitTests/Test_TarskiWorld_Equals.cs rename to Validator/UnitTests/Test_BivalenceWorld_Equals.cs index b417912..f0aae1c 100644 --- a/Validator/UnitTests/Test_TarskiWorld_Equals.cs +++ b/Validator/UnitTests/Test_BivalenceWorld_Equals.cs @@ -6,12 +6,12 @@ namespace UnitTests { [TestClass] - public class Test_TarskiWorld_Equals + public class Test_BivalenceWorld_Equals { [TestMethod] public void TarskiWorld_Equals() { - TarskiWorld world = new TarskiWorld(); + BivalenceWorld world = new BivalenceWorld(); List sentences = new List { " a = d ", @@ -20,9 +20,9 @@ public void TarskiWorld_Equals() }; List worldObjects = new List { - new WorldObject(new List { "a", "d" }, new List {TarskiWorldDataFields.TET, TarskiWorldDataFields.LARGE }, new List {3, 3 }), - new WorldObject(new List { "b" }, new List {TarskiWorldDataFields.TET, TarskiWorldDataFields.MEDIUM }, new List {4, 4 }), - new WorldObject(new List { "c" }, new List {TarskiWorldDataFields.CUBE, TarskiWorldDataFields.MEDIUM }, new List {2, 2 }) + new WorldObject(new List { "a", "d" }, new List {BivalenceWorldDataFields.TET, BivalenceWorldDataFields.LARGE }, new List {3, 3 }), + new WorldObject(new List { "b" }, new List {BivalenceWorldDataFields.TET, BivalenceWorldDataFields.MEDIUM }, new List {4, 4 }), + new WorldObject(new List { "c" }, new List {BivalenceWorldDataFields.CUBE, BivalenceWorldDataFields.MEDIUM }, new List {2, 2 }) }; WorldParameter parameter = new WorldParameter(worldObjects, sentences); var result = world.Check(parameter); @@ -35,7 +35,7 @@ public void TarskiWorld_Equals() [TestMethod] public void TarskiWorld_NotEquals() { - TarskiWorld world = new TarskiWorld(); + BivalenceWorld world = new BivalenceWorld(); List sentences = new List { " b \u2260 d ", @@ -44,9 +44,9 @@ public void TarskiWorld_NotEquals() }; List worldObjects = new List { - new WorldObject(new List { "a", "d" }, new List {TarskiWorldDataFields.TET, TarskiWorldDataFields.LARGE }, new List {3, 3 }), - new WorldObject(new List { "b" }, new List {TarskiWorldDataFields.TET, TarskiWorldDataFields.MEDIUM }, new List {4, 4 }), - new WorldObject(new List { "c" }, new List {TarskiWorldDataFields.CUBE, TarskiWorldDataFields.MEDIUM }, new List {2, 2 }) + new WorldObject(new List { "a", "d" }, new List {BivalenceWorldDataFields.TET, BivalenceWorldDataFields.LARGE }, new List {3, 3 }), + new WorldObject(new List { "b" }, new List {BivalenceWorldDataFields.TET, BivalenceWorldDataFields.MEDIUM }, new List {4, 4 }), + new WorldObject(new List { "c" }, new List {BivalenceWorldDataFields.CUBE, BivalenceWorldDataFields.MEDIUM }, new List {2, 2 }) }; WorldParameter parameter = new WorldParameter(worldObjects, sentences); var result = world.Check(parameter); diff --git a/Validator/UnitTests/Test_Tarski_Functions.cs b/Validator/UnitTests/Test_BivalenceWorld_Functions.cs similarity index 76% rename from Validator/UnitTests/Test_Tarski_Functions.cs rename to Validator/UnitTests/Test_BivalenceWorld_Functions.cs index a9d6cde..a203b42 100644 --- a/Validator/UnitTests/Test_Tarski_Functions.cs +++ b/Validator/UnitTests/Test_BivalenceWorld_Functions.cs @@ -8,16 +8,16 @@ namespace UnitTests { [TestClass] - public class Test_Tarski_Functions + public class Test_BivalenceWorld_Functions { [TestMethod] public void Test_Functions() { List worldObjects = new List { - new WorldObject(new List { "a" }, new List {TarskiWorldDataFields.CUBE, TarskiWorldDataFields.LARGE }, new List { 1, 1 }), - new WorldObject(new List { "b" }, new List {TarskiWorldDataFields.TET, TarskiWorldDataFields.MEDIUM }, new List { 2, 1 }), - new WorldObject(new List { "c" }, new List {TarskiWorldDataFields.TET, TarskiWorldDataFields.SMALL }, new List { 2, 4 }), + new WorldObject(new List { "a" }, new List {BivalenceWorldDataFields.CUBE, BivalenceWorldDataFields.LARGE }, new List { 1, 1 }), + new WorldObject(new List { "b" }, new List {BivalenceWorldDataFields.TET, BivalenceWorldDataFields.MEDIUM }, new List { 2, 1 }), + new WorldObject(new List { "c" }, new List {BivalenceWorldDataFields.TET, BivalenceWorldDataFields.SMALL }, new List { 2, 4 }), }; List sentences = new List() { @@ -28,7 +28,7 @@ public void Test_Functions() "Cube(fm(c))" }; - TarskiWorld world = new TarskiWorld(); + BivalenceWorld world = new BivalenceWorld(); WorldParameter parameter = new WorldParameter(worldObjects, sentences); var result = world.Check(parameter); diff --git a/Validator/UnitTests/Test_TarskiWorld_Implication.cs b/Validator/UnitTests/Test_BivalenceWorld_Implication.cs similarity index 76% rename from Validator/UnitTests/Test_TarskiWorld_Implication.cs rename to Validator/UnitTests/Test_BivalenceWorld_Implication.cs index 23161cc..ee51588 100644 --- a/Validator/UnitTests/Test_TarskiWorld_Implication.cs +++ b/Validator/UnitTests/Test_BivalenceWorld_Implication.cs @@ -8,12 +8,12 @@ namespace UnitTests { [TestClass] - public class Test_TarskiWorld_Implication + public class Test_BivalenceWorld_Implication { [TestMethod] public void TarskiWorld_Implications() { - TarskiWorld world = new TarskiWorld(); + BivalenceWorld world = new BivalenceWorld(); List sentences = new List { "Tet(a) \u2192 Tet(b)" , @@ -23,9 +23,9 @@ public void TarskiWorld_Implications() }; List worldObjects = new List { - new WorldObject(new List { "a" }, new List {TarskiWorldDataFields.TET, TarskiWorldDataFields.LARGE }, new List {3, 3 }), - new WorldObject(new List { "b" }, new List {TarskiWorldDataFields.TET, TarskiWorldDataFields.MEDIUM }, new List {4, 4 }), - new WorldObject(new List { "c" }, new List {TarskiWorldDataFields.CUBE, TarskiWorldDataFields.MEDIUM }, new List {2, 2 }) + new WorldObject(new List { "a" }, new List {BivalenceWorldDataFields.TET, BivalenceWorldDataFields.LARGE }, new List {3, 3 }), + new WorldObject(new List { "b" }, new List {BivalenceWorldDataFields.TET, BivalenceWorldDataFields.MEDIUM }, new List {4, 4 }), + new WorldObject(new List { "c" }, new List {BivalenceWorldDataFields.CUBE, BivalenceWorldDataFields.MEDIUM }, new List {2, 2 }) }; WorldParameter parameter = new WorldParameter(worldObjects, sentences); var result = world.Check(parameter); diff --git a/Validator/UnitTests/Test_TarskiWorld_IntegrationTests.cs b/Validator/UnitTests/Test_BivalenceWorld_IntegrationTests.cs similarity index 72% rename from Validator/UnitTests/Test_TarskiWorld_IntegrationTests.cs rename to Validator/UnitTests/Test_BivalenceWorld_IntegrationTests.cs index 2623dfa..992ccf2 100644 --- a/Validator/UnitTests/Test_TarskiWorld_IntegrationTests.cs +++ b/Validator/UnitTests/Test_BivalenceWorld_IntegrationTests.cs @@ -6,7 +6,7 @@ namespace UnitTests { [TestClass] - public class Test_TarskiWorld_IntegrationTests + public class Test_BivalenceWorld_IntegrationTests { private const string AllQuantum = "\u2200"; private const string ExistQuantum = "\u2203"; @@ -23,7 +23,7 @@ public void TarskiWorld_ComplexSentences() "(\u2203x Dodec(x)) \u2192 ((\u2200y (Tet(y) \u2192 Medium(y))) \u2227 Dodec(e))" }; WorldParameter parameter = new WorldParameter(CreateWorld(), sentences); - TarskiWorld world = new TarskiWorld(); + BivalenceWorld world = new BivalenceWorld(); var result = world.Check(parameter); Assert.IsTrue(result.Result.Value[0].Value == EValidationResult.True); Assert.IsFalse(result.Result.Value[1].Value == EValidationResult.True); @@ -38,11 +38,11 @@ public void TarskiWorld_IntegrationRound01() }; List worldObjects = new List { - new WorldObject(new List {"a"}, new List {TarskiWorldDataFields.TET, TarskiWorldDataFields.SMALL}, new List {3, 3}), - new WorldObject(new List(), new List {TarskiWorldDataFields.DODEC, TarskiWorldDataFields.LARGE}, new List {4, 4}) + new WorldObject(new List {"a"}, new List {BivalenceWorldDataFields.TET, BivalenceWorldDataFields.SMALL}, new List {3, 3}), + new WorldObject(new List(), new List {BivalenceWorldDataFields.DODEC, BivalenceWorldDataFields.LARGE}, new List {4, 4}) }; WorldParameter parameter = new WorldParameter(worldObjects, sentences); - TarskiWorld world = new TarskiWorld(); + BivalenceWorld world = new BivalenceWorld(); var result = world.Check(parameter); Assert.IsTrue(result.Result.Value[0].Value == EValidationResult.True); } @@ -56,12 +56,12 @@ public void TarskiWorld_IntegrationRound02() }; List worldObjects = new List { - new WorldObject(new List {"a"}, new List {TarskiWorldDataFields.CUBE, TarskiWorldDataFields.LARGE}, + new WorldObject(new List {"a"}, new List {BivalenceWorldDataFields.CUBE, BivalenceWorldDataFields.LARGE}, new List {3, 3}), - new WorldObject(new List(), new List {TarskiWorldDataFields.TET, TarskiWorldDataFields.LARGE}, new List {3, 3}) + new WorldObject(new List(), new List {BivalenceWorldDataFields.TET, BivalenceWorldDataFields.LARGE}, new List {3, 3}) }; WorldParameter parameter = new WorldParameter(worldObjects, sentences); - TarskiWorld world = new TarskiWorld(); + BivalenceWorld world = new BivalenceWorld(); var result = world.Check(parameter); Assert.IsTrue(result.Result.Value[0].Value == EValidationResult.True); } @@ -77,14 +77,14 @@ public void TarskiWorld_IntegrationRound03() }; List worldObjects = new List { - new WorldObject(new List {"a"}, new List {TarskiWorldDataFields.CUBE, TarskiWorldDataFields.LARGE}, + new WorldObject(new List {"a"}, new List {BivalenceWorldDataFields.CUBE, BivalenceWorldDataFields.LARGE}, new List {3, 3}), - new WorldObject(new List {"b"}, new List {TarskiWorldDataFields.CUBE, TarskiWorldDataFields.LARGE}, + new WorldObject(new List {"b"}, new List {BivalenceWorldDataFields.CUBE, BivalenceWorldDataFields.LARGE}, new List {3, 3}), - new WorldObject(new List(), new List {TarskiWorldDataFields.TET, TarskiWorldDataFields.MEDIUM}, new List {3, 3}) + new WorldObject(new List(), new List {BivalenceWorldDataFields.TET, BivalenceWorldDataFields.MEDIUM}, new List {3, 3}) }; WorldParameter parameter = new WorldParameter(worldObjects, sentences); - TarskiWorld world = new TarskiWorld(); + BivalenceWorld world = new BivalenceWorld(); var result = world.Check(parameter); Assert.IsTrue(result.Result.Value[0].Value == EValidationResult.True); } @@ -94,16 +94,16 @@ public void TarskiWorld_ModelRepresentation() { List worldObjects = new List { - new WorldObject(new List {"a"}, new List {TarskiWorldDataFields.CUBE, TarskiWorldDataFields.LARGE}, + new WorldObject(new List {"a"}, new List {BivalenceWorldDataFields.CUBE, BivalenceWorldDataFields.LARGE}, new List {3, 3}), - new WorldObject(new List {"b"}, new List {TarskiWorldDataFields.CUBE, TarskiWorldDataFields.LARGE}, + new WorldObject(new List {"b"}, new List {BivalenceWorldDataFields.CUBE, BivalenceWorldDataFields.LARGE}, new List {5, 3}), - new WorldObject(new List {"c"}, new List {TarskiWorldDataFields.CUBE, TarskiWorldDataFields.LARGE}, + new WorldObject(new List {"c"}, new List {BivalenceWorldDataFields.CUBE, BivalenceWorldDataFields.LARGE}, new List {4, 3}), - new WorldObject(new List(), new List {TarskiWorldDataFields.TET, TarskiWorldDataFields.MEDIUM}, new List {3, 5}) + new WorldObject(new List(), new List {BivalenceWorldDataFields.TET, BivalenceWorldDataFields.MEDIUM}, new List {3, 5}) }; WorldParameter parameter = new WorldParameter(worldObjects, new List()); - TarskiWorld world = new TarskiWorld(); + BivalenceWorld world = new BivalenceWorld(); var result = world.Check(parameter); var representation = world.GetPl1Structure().GetModelRepresentation(); } @@ -112,18 +112,18 @@ private List CreateWorld() { List worldObjects = new List { - new WorldObject(new List {"a"}, new List {TarskiWorldDataFields.TET, TarskiWorldDataFields.MEDIUM}, + new WorldObject(new List {"a"}, new List {BivalenceWorldDataFields.TET, BivalenceWorldDataFields.MEDIUM}, new List {3, 3}), - new WorldObject(new List {"b"}, new List {TarskiWorldDataFields.TET, TarskiWorldDataFields.MEDIUM}, + new WorldObject(new List {"b"}, new List {BivalenceWorldDataFields.TET, BivalenceWorldDataFields.MEDIUM}, new List {4, 4}), - new WorldObject(new List {"c"}, new List {TarskiWorldDataFields.TET, TarskiWorldDataFields.MEDIUM}, + new WorldObject(new List {"c"}, new List {BivalenceWorldDataFields.TET, BivalenceWorldDataFields.MEDIUM}, new List {2, 2}), - new WorldObject(new List {"d"}, new List {TarskiWorldDataFields.TET, TarskiWorldDataFields.MEDIUM}, + new WorldObject(new List {"d"}, new List {BivalenceWorldDataFields.TET, BivalenceWorldDataFields.MEDIUM}, new List {2, 2}), - new WorldObject(new List(), new List {TarskiWorldDataFields.CUBE, TarskiWorldDataFields.MEDIUM}, new List {2, 2}), - new WorldObject(new List(), new List {TarskiWorldDataFields.CUBE, TarskiWorldDataFields.MEDIUM}, new List {2, 2}), - new WorldObject(new List(), new List {TarskiWorldDataFields.CUBE, TarskiWorldDataFields.MEDIUM}, new List {2, 2}), - new WorldObject(new List {"f"}, new List {TarskiWorldDataFields.DODEC, TarskiWorldDataFields.MEDIUM}, + new WorldObject(new List(), new List {BivalenceWorldDataFields.CUBE, BivalenceWorldDataFields.MEDIUM}, new List {2, 2}), + new WorldObject(new List(), new List {BivalenceWorldDataFields.CUBE, BivalenceWorldDataFields.MEDIUM}, new List {2, 2}), + new WorldObject(new List(), new List {BivalenceWorldDataFields.CUBE, BivalenceWorldDataFields.MEDIUM}, new List {2, 2}), + new WorldObject(new List {"f"}, new List {BivalenceWorldDataFields.DODEC, BivalenceWorldDataFields.MEDIUM}, new List {2, 2}) }; return worldObjects; diff --git a/Validator/UnitTests/Test_TarskiWorld_Negation.cs b/Validator/UnitTests/Test_BivalenceWorld_Negation.cs similarity index 75% rename from Validator/UnitTests/Test_TarskiWorld_Negation.cs rename to Validator/UnitTests/Test_BivalenceWorld_Negation.cs index 71262c9..386c759 100644 --- a/Validator/UnitTests/Test_TarskiWorld_Negation.cs +++ b/Validator/UnitTests/Test_BivalenceWorld_Negation.cs @@ -8,12 +8,12 @@ namespace UnitTests { [TestClass] - public class Test_TarskiWorld_Negation + public class Test_BivalenceWorld_Negation { [TestMethod] public void TarskiWorld_Negation() { - TarskiWorld world = new TarskiWorld(); + BivalenceWorld world = new BivalenceWorld(); List sentences = new List { "\u00ac Tet(a)", @@ -22,9 +22,9 @@ public void TarskiWorld_Negation() }; List worldObjects = new List { - new WorldObject(new List { "a" }, new List {TarskiWorldDataFields.TET, TarskiWorldDataFields.LARGE }, new List {3, 3 }), - new WorldObject(new List { "b" }, new List {TarskiWorldDataFields.TET, TarskiWorldDataFields.MEDIUM }, new List {4, 4 }), - new WorldObject(new List { "c" }, new List {TarskiWorldDataFields.TET, TarskiWorldDataFields.MEDIUM }, new List {2, 2 }) + new WorldObject(new List { "a" }, new List {BivalenceWorldDataFields.TET, BivalenceWorldDataFields.LARGE }, new List {3, 3 }), + new WorldObject(new List { "b" }, new List {BivalenceWorldDataFields.TET, BivalenceWorldDataFields.MEDIUM }, new List {4, 4 }), + new WorldObject(new List { "c" }, new List {BivalenceWorldDataFields.TET, BivalenceWorldDataFields.MEDIUM }, new List {2, 2 }) }; WorldParameter parameter = new WorldParameter(worldObjects, sentences); var result = world.Check(parameter); diff --git a/Validator/UnitTests/Test_TarskiWorld_Parantheses.cs b/Validator/UnitTests/Test_BivalenceWorld_Parantheses.cs similarity index 68% rename from Validator/UnitTests/Test_TarskiWorld_Parantheses.cs rename to Validator/UnitTests/Test_BivalenceWorld_Parantheses.cs index 52dad91..eb36a27 100644 --- a/Validator/UnitTests/Test_TarskiWorld_Parantheses.cs +++ b/Validator/UnitTests/Test_BivalenceWorld_Parantheses.cs @@ -8,21 +8,21 @@ namespace UnitTests { [TestClass] - public class Test_TarskiWorld_Parantheses + public class Test_BivalenceWorld_Parantheses { [TestMethod] public void TarskiWorld_Right() { - TarskiWorld world = new TarskiWorld(); + BivalenceWorld world = new BivalenceWorld(); List sentences = new List { "Tet(a) \u2227 ( Tet(b) \u2228 Tet(c))" }; List worldObjects = new List { - new WorldObject(new List { "a" }, new List {TarskiWorldDataFields.TET, TarskiWorldDataFields.LARGE }, new List {3, 3 }), - new WorldObject(new List { "b" }, new List {TarskiWorldDataFields.TET, TarskiWorldDataFields.MEDIUM }, new List {4, 4 }), - new WorldObject(new List { "c" }, new List {TarskiWorldDataFields.CUBE, TarskiWorldDataFields.MEDIUM }, new List {2, 2 }) + new WorldObject(new List { "a" }, new List {BivalenceWorldDataFields.TET, BivalenceWorldDataFields.LARGE }, new List {3, 3 }), + new WorldObject(new List { "b" }, new List {BivalenceWorldDataFields.TET, BivalenceWorldDataFields.MEDIUM }, new List {4, 4 }), + new WorldObject(new List { "c" }, new List {BivalenceWorldDataFields.CUBE, BivalenceWorldDataFields.MEDIUM }, new List {2, 2 }) }; WorldParameter parameter = new WorldParameter(worldObjects, sentences); var result = world.Check(parameter); @@ -34,16 +34,16 @@ public void TarskiWorld_Right() [TestMethod] public void TarskiWorld_Left() { - TarskiWorld world = new TarskiWorld(); + BivalenceWorld world = new BivalenceWorld(); List sentences = new List { "(Tet(b) \u2228 Tet(c)) \u2227 Tet(a) " }; List worldObjects = new List { - new WorldObject(new List { "a" }, new List {TarskiWorldDataFields.TET, TarskiWorldDataFields.LARGE }, new List {3, 3 }), - new WorldObject(new List { "b" }, new List {TarskiWorldDataFields.TET, TarskiWorldDataFields.MEDIUM }, new List {4, 4 }), - new WorldObject(new List { "c" }, new List {TarskiWorldDataFields.CUBE, TarskiWorldDataFields.MEDIUM }, new List {2, 2 }) + new WorldObject(new List { "a" }, new List {BivalenceWorldDataFields.TET, BivalenceWorldDataFields.LARGE }, new List {3, 3 }), + new WorldObject(new List { "b" }, new List {BivalenceWorldDataFields.TET, BivalenceWorldDataFields.MEDIUM }, new List {4, 4 }), + new WorldObject(new List { "c" }, new List {BivalenceWorldDataFields.CUBE, BivalenceWorldDataFields.MEDIUM }, new List {2, 2 }) }; WorldParameter parameter = new WorldParameter(worldObjects, sentences); var result = world.Check(parameter); @@ -55,17 +55,17 @@ public void TarskiWorld_Left() [TestMethod] public void TarskiWorld_CNF() { - TarskiWorld world = new TarskiWorld(); + BivalenceWorld world = new BivalenceWorld(); List sentences = new List { "(Tet(a) \u2228 Tet(b)) \u2227 Tet(a) \u2227 (Tet(d) \u2228 Tet(c)) \u2227 Tet(a) " }; List worldObjects = new List { - new WorldObject(new List { "a" }, new List {TarskiWorldDataFields.TET, TarskiWorldDataFields.LARGE }, new List {3, 3 }), - new WorldObject(new List { "b" }, new List {TarskiWorldDataFields.TET, TarskiWorldDataFields.MEDIUM }, new List {4, 4 }), - new WorldObject(new List { "c" }, new List {TarskiWorldDataFields.CUBE, TarskiWorldDataFields.MEDIUM }, new List {2, 2 }), - new WorldObject(new List { "d" }, new List {TarskiWorldDataFields.CUBE, TarskiWorldDataFields.MEDIUM }, new List {2, 2 }) + new WorldObject(new List { "a" }, new List {BivalenceWorldDataFields.TET, BivalenceWorldDataFields.LARGE }, new List {3, 3 }), + new WorldObject(new List { "b" }, new List {BivalenceWorldDataFields.TET, BivalenceWorldDataFields.MEDIUM }, new List {4, 4 }), + new WorldObject(new List { "c" }, new List {BivalenceWorldDataFields.CUBE, BivalenceWorldDataFields.MEDIUM }, new List {2, 2 }), + new WorldObject(new List { "d" }, new List {BivalenceWorldDataFields.CUBE, BivalenceWorldDataFields.MEDIUM }, new List {2, 2 }) }; WorldParameter parameter = new WorldParameter(worldObjects, sentences); var result = world.Check(parameter); @@ -77,7 +77,7 @@ public void TarskiWorld_CNF() [TestMethod] public void TarskiWorld_Implication() { - TarskiWorld world = new TarskiWorld(); + BivalenceWorld world = new BivalenceWorld(); List sentences = new List { "(Tet(a) \u2228 Tet(b)) \u2192 (Tet(a) \u2227 Tet(d) \u2227 (Cube(d) \u2228 Cube(a)))", @@ -85,10 +85,10 @@ public void TarskiWorld_Implication() }; List worldObjects = new List { - new WorldObject(new List { "a" }, new List {TarskiWorldDataFields.TET, TarskiWorldDataFields.LARGE }, new List {3, 3 }), - new WorldObject(new List { "b" }, new List {TarskiWorldDataFields.TET, TarskiWorldDataFields.MEDIUM }, new List {4, 4 }), - new WorldObject(new List { "c" }, new List {TarskiWorldDataFields.CUBE, TarskiWorldDataFields.MEDIUM }, new List {2, 2 }), - new WorldObject(new List { "d" }, new List {TarskiWorldDataFields.CUBE, TarskiWorldDataFields.MEDIUM }, new List {2, 2 }) + new WorldObject(new List { "a" }, new List {BivalenceWorldDataFields.TET, BivalenceWorldDataFields.LARGE }, new List {3, 3 }), + new WorldObject(new List { "b" }, new List {BivalenceWorldDataFields.TET, BivalenceWorldDataFields.MEDIUM }, new List {4, 4 }), + new WorldObject(new List { "c" }, new List {BivalenceWorldDataFields.CUBE, BivalenceWorldDataFields.MEDIUM }, new List {2, 2 }), + new WorldObject(new List { "d" }, new List {BivalenceWorldDataFields.CUBE, BivalenceWorldDataFields.MEDIUM }, new List {2, 2 }) }; WorldParameter parameter = new WorldParameter(worldObjects, sentences); var result = world.Check(parameter); diff --git a/Validator/UnitTests/Test_TarskiWorld_Parsing.cs b/Validator/UnitTests/Test_BivalenceWorld_Parsing.cs similarity index 89% rename from Validator/UnitTests/Test_TarskiWorld_Parsing.cs rename to Validator/UnitTests/Test_BivalenceWorld_Parsing.cs index ed779e7..ef2ebc0 100644 --- a/Validator/UnitTests/Test_TarskiWorld_Parsing.cs +++ b/Validator/UnitTests/Test_BivalenceWorld_Parsing.cs @@ -6,12 +6,12 @@ namespace UnitTests { [TestClass] - public class Test_TarskiWorld_Parsing + public class Test_BivalenceWorld_Parsing { [TestMethod] public void TarskiWorld_Atomar_Valid() { - TarskiWorld world = new TarskiWorld(); + BivalenceWorld world = new BivalenceWorld(); WorldParameter parameter = new WorldParameter(CreateWorldObject(), Sentences_Atomar()); var result = world.Check(parameter); Assert.AreEqual(result.Result.Value.Count, 3); @@ -23,7 +23,7 @@ public void TarskiWorld_Atomar_Valid() [TestMethod] public void TarskiWorld_Conjunction_Valid() { - TarskiWorld world = new TarskiWorld(); + BivalenceWorld world = new BivalenceWorld(); WorldParameter parameter = new WorldParameter(CreateWorldObject(), Sentences_Conjunction()); var result = world.Check(parameter); Assert.AreEqual(result.Result.Value.Count, 4); @@ -36,7 +36,7 @@ public void TarskiWorld_Conjunction_Valid() [TestMethod] public void TarskiWorld_DisAndConjunction_Valid() { - TarskiWorld world = new TarskiWorld(); + BivalenceWorld world = new BivalenceWorld(); WorldParameter parameter = new WorldParameter(CreateWorldObject(), Sentences_DisAndConjunction()); var result = world.Check(parameter); Assert.AreEqual(result.Result.Value.Count, 4); @@ -49,7 +49,7 @@ public void TarskiWorld_DisAndConjunction_Valid() [TestMethod] public void TarskiWorld_Disjunction_Valid() { - TarskiWorld world = new TarskiWorld(); + BivalenceWorld world = new BivalenceWorld(); WorldParameter parameter = new WorldParameter(CreateWorldObject(), Sentences_Disjunction()); var result = world.Check(parameter); Assert.AreEqual(result.Result.Value.Count, 5); @@ -63,7 +63,7 @@ public void TarskiWorld_Disjunction_Valid() [TestMethod] public void TarskiWorld_InvalidOperator() { - TarskiWorld world = new TarskiWorld(); + BivalenceWorld world = new BivalenceWorld(); WorldParameter parameter = new WorldParameter(CreateWorldObject(), Sentences_InvalidOperator()); var result = world.Check(parameter); Assert.AreEqual(result.Result.Value.Count, 2); @@ -76,7 +76,7 @@ public void TarskiWorld_InvalidOperator() [TestMethod] public void TarskiWorld_EmptyConstant() { - TarskiWorld world = new TarskiWorld(); + BivalenceWorld world = new BivalenceWorld(); List stentences = new List() { "Tet()" @@ -94,10 +94,10 @@ private List CreateWorldObject() { List worldObjects = new List { - new WorldObject(new List {"a"}, new List {TarskiWorldDataFields.TET, TarskiWorldDataFields.LARGE}, new List {1, 2}), - new WorldObject(new List {"b"}, new List {TarskiWorldDataFields.TET, TarskiWorldDataFields.MEDIUM}, + new WorldObject(new List {"a"}, new List {BivalenceWorldDataFields.TET, BivalenceWorldDataFields.LARGE}, new List {1, 2}), + new WorldObject(new List {"b"}, new List {BivalenceWorldDataFields.TET, BivalenceWorldDataFields.MEDIUM}, new List {1, 4}), - new WorldObject(new List {"c"}, new List {TarskiWorldDataFields.TET, TarskiWorldDataFields.SMALL}, new List {2, 4}) + new WorldObject(new List {"c"}, new List {BivalenceWorldDataFields.TET, BivalenceWorldDataFields.SMALL}, new List {2, 4}) }; return worldObjects; } diff --git a/Validator/UnitTests/Test_TarskiWorld_Predicate.cs b/Validator/UnitTests/Test_BivalenceWorld_Predicate.cs similarity index 66% rename from Validator/UnitTests/Test_TarskiWorld_Predicate.cs rename to Validator/UnitTests/Test_BivalenceWorld_Predicate.cs index 8c30c8c..b4fa95f 100644 --- a/Validator/UnitTests/Test_TarskiWorld_Predicate.cs +++ b/Validator/UnitTests/Test_BivalenceWorld_Predicate.cs @@ -8,13 +8,13 @@ namespace UnitTests { [TestClass] - public class Test_TarskiWorld_Predicate + public class Test_BivalenceWorld_Predicate { [TestMethod] public void TarskiWorld_Adjoins() { - TarskiWorld world = new TarskiWorld(); + BivalenceWorld world = new BivalenceWorld(); List sentences = new List { "Adjoins(a,b)", @@ -25,10 +25,10 @@ public void TarskiWorld_Adjoins() }; List worldObjects = new List { - new WorldObject(new List { "a" }, new List {TarskiWorldDataFields.TET, TarskiWorldDataFields.LARGE }, new List {3, 3 }), - new WorldObject(new List { "b" }, new List {TarskiWorldDataFields.TET, TarskiWorldDataFields.MEDIUM }, new List {3, 4 }), - new WorldObject(new List { "c" }, new List {TarskiWorldDataFields.TET, TarskiWorldDataFields.MEDIUM }, new List {4, 3 }), - new WorldObject(new List { "d" }, new List {TarskiWorldDataFields.TET, TarskiWorldDataFields.MEDIUM }, new List {4, 4 }), + new WorldObject(new List { "a" }, new List {BivalenceWorldDataFields.TET, BivalenceWorldDataFields.LARGE }, new List {3, 3 }), + new WorldObject(new List { "b" }, new List {BivalenceWorldDataFields.TET, BivalenceWorldDataFields.MEDIUM }, new List {3, 4 }), + new WorldObject(new List { "c" }, new List {BivalenceWorldDataFields.TET, BivalenceWorldDataFields.MEDIUM }, new List {4, 3 }), + new WorldObject(new List { "d" }, new List {BivalenceWorldDataFields.TET, BivalenceWorldDataFields.MEDIUM }, new List {4, 4 }), }; WorldParameter parameter = new WorldParameter(worldObjects, sentences); var result = world.Check(parameter); @@ -43,7 +43,7 @@ public void TarskiWorld_Adjoins() [TestMethod] public void TarskiWorld_BackOf() { - TarskiWorld world = new TarskiWorld(); + BivalenceWorld world = new BivalenceWorld(); List sentences = new List { "BackOf(a,b)", @@ -53,11 +53,11 @@ public void TarskiWorld_BackOf() }; List worldObjects = new List { - new WorldObject(new List { "a" }, new List {TarskiWorldDataFields.TET, TarskiWorldDataFields.LARGE }, new List {3, 3 }), - new WorldObject(new List { "b" }, new List {TarskiWorldDataFields.TET, TarskiWorldDataFields.MEDIUM }, new List {4, 4 }), - new WorldObject(new List { "c" }, new List {TarskiWorldDataFields.TET, TarskiWorldDataFields.MEDIUM }, new List {2, 2 }), - new WorldObject(new List { "d" }, new List {TarskiWorldDataFields.TET, TarskiWorldDataFields.MEDIUM }, new List {3, 4 }), - new WorldObject(new List { "e" }, new List {TarskiWorldDataFields.TET, TarskiWorldDataFields.MEDIUM }, new List {3, 2 }), + new WorldObject(new List { "a" }, new List {BivalenceWorldDataFields.TET, BivalenceWorldDataFields.LARGE }, new List {3, 3 }), + new WorldObject(new List { "b" }, new List {BivalenceWorldDataFields.TET, BivalenceWorldDataFields.MEDIUM }, new List {4, 4 }), + new WorldObject(new List { "c" }, new List {BivalenceWorldDataFields.TET, BivalenceWorldDataFields.MEDIUM }, new List {2, 2 }), + new WorldObject(new List { "d" }, new List {BivalenceWorldDataFields.TET, BivalenceWorldDataFields.MEDIUM }, new List {3, 4 }), + new WorldObject(new List { "e" }, new List {BivalenceWorldDataFields.TET, BivalenceWorldDataFields.MEDIUM }, new List {3, 2 }), }; WorldParameter parameter = new WorldParameter(worldObjects, sentences); var result = world.Check(parameter); @@ -72,7 +72,7 @@ public void TarskiWorld_BackOf() [TestMethod] public void TarskiWorld_Between() { - TarskiWorld world = new TarskiWorld(); + BivalenceWorld world = new BivalenceWorld(); List sentences = new List { "Between(a,b,c)", @@ -82,11 +82,11 @@ public void TarskiWorld_Between() }; List worldObjects = new List { - new WorldObject(new List { "a" }, new List {TarskiWorldDataFields.TET, TarskiWorldDataFields.LARGE }, new List {3, 3 }), - new WorldObject(new List { "b" }, new List {TarskiWorldDataFields.TET, TarskiWorldDataFields.MEDIUM }, new List {4, 4 }), - new WorldObject(new List { "c" }, new List {TarskiWorldDataFields.TET, TarskiWorldDataFields.MEDIUM }, new List {2, 2 }), - new WorldObject(new List { "d" }, new List {TarskiWorldDataFields.TET, TarskiWorldDataFields.MEDIUM }, new List {3, 4 }), - new WorldObject(new List { "e" }, new List {TarskiWorldDataFields.TET, TarskiWorldDataFields.MEDIUM }, new List {3, 2 }), + new WorldObject(new List { "a" }, new List {BivalenceWorldDataFields.TET, BivalenceWorldDataFields.LARGE }, new List {3, 3 }), + new WorldObject(new List { "b" }, new List {BivalenceWorldDataFields.TET, BivalenceWorldDataFields.MEDIUM }, new List {4, 4 }), + new WorldObject(new List { "c" }, new List {BivalenceWorldDataFields.TET, BivalenceWorldDataFields.MEDIUM }, new List {2, 2 }), + new WorldObject(new List { "d" }, new List {BivalenceWorldDataFields.TET, BivalenceWorldDataFields.MEDIUM }, new List {3, 4 }), + new WorldObject(new List { "e" }, new List {BivalenceWorldDataFields.TET, BivalenceWorldDataFields.MEDIUM }, new List {3, 2 }), }; WorldParameter parameter = new WorldParameter(worldObjects, sentences); var result = world.Check(parameter); @@ -101,18 +101,18 @@ public void TarskiWorld_Between() [TestMethod] public void TarskiWorld_Larger() { - TarskiWorld world = new TarskiWorld(); + BivalenceWorld world = new BivalenceWorld(); List sentences = new List { "Large(a) \u2227 Larger(a ,b)" }; List worldObjects = new List { - new WorldObject(new List { "a" }, new List {TarskiWorldDataFields.TET, TarskiWorldDataFields.LARGE }, new List {3, 3 }), - new WorldObject(new List { "b" }, new List {TarskiWorldDataFields.TET, TarskiWorldDataFields.MEDIUM }, new List {4, 4 }), - new WorldObject(new List { "c" }, new List {TarskiWorldDataFields.TET, TarskiWorldDataFields.MEDIUM }, new List {2, 2 }), - new WorldObject(new List { "d" }, new List {TarskiWorldDataFields.TET, TarskiWorldDataFields.MEDIUM }, new List {3, 4 }), - new WorldObject(new List { "e" }, new List {TarskiWorldDataFields.TET, TarskiWorldDataFields.MEDIUM }, new List {3, 2 }), + new WorldObject(new List { "a" }, new List {BivalenceWorldDataFields.TET, BivalenceWorldDataFields.LARGE }, new List {3, 3 }), + new WorldObject(new List { "b" }, new List {BivalenceWorldDataFields.TET, BivalenceWorldDataFields.MEDIUM }, new List {4, 4 }), + new WorldObject(new List { "c" }, new List {BivalenceWorldDataFields.TET, BivalenceWorldDataFields.MEDIUM }, new List {2, 2 }), + new WorldObject(new List { "d" }, new List {BivalenceWorldDataFields.TET, BivalenceWorldDataFields.MEDIUM }, new List {3, 4 }), + new WorldObject(new List { "e" }, new List {BivalenceWorldDataFields.TET, BivalenceWorldDataFields.MEDIUM }, new List {3, 2 }), }; WorldParameter parameter = new WorldParameter(worldObjects, sentences); var result = world.Check(parameter); @@ -125,18 +125,18 @@ public void TarskiWorld_Larger() [TestMethod] public void TarskiWorld_LeftOf() { - TarskiWorld world = new TarskiWorld(); + BivalenceWorld world = new BivalenceWorld(); List sentences = new List { "LeftOf(a,b)" }; List worldObjects = new List { - new WorldObject(new List { "a" }, new List {TarskiWorldDataFields.TET, TarskiWorldDataFields.LARGE }, new List {3, 3 }), - new WorldObject(new List { "b" }, new List {TarskiWorldDataFields.TET, TarskiWorldDataFields.MEDIUM }, new List {4, 4 }), - new WorldObject(new List { "c" }, new List {TarskiWorldDataFields.TET, TarskiWorldDataFields.MEDIUM }, new List {2, 2 }), - new WorldObject(new List { "d" }, new List {TarskiWorldDataFields.TET, TarskiWorldDataFields.MEDIUM }, new List {3, 4 }), - new WorldObject(new List { "e" }, new List {TarskiWorldDataFields.TET, TarskiWorldDataFields.MEDIUM }, new List {3, 2 }), + new WorldObject(new List { "a" }, new List {BivalenceWorldDataFields.TET, BivalenceWorldDataFields.LARGE }, new List {3, 3 }), + new WorldObject(new List { "b" }, new List {BivalenceWorldDataFields.TET, BivalenceWorldDataFields.MEDIUM }, new List {4, 4 }), + new WorldObject(new List { "c" }, new List {BivalenceWorldDataFields.TET, BivalenceWorldDataFields.MEDIUM }, new List {2, 2 }), + new WorldObject(new List { "d" }, new List {BivalenceWorldDataFields.TET, BivalenceWorldDataFields.MEDIUM }, new List {3, 4 }), + new WorldObject(new List { "e" }, new List {BivalenceWorldDataFields.TET, BivalenceWorldDataFields.MEDIUM }, new List {3, 2 }), }; WorldParameter parameter = new WorldParameter(worldObjects, sentences); var result = world.Check(parameter); diff --git a/Validator/UnitTests/Test_TarskiWorld_Quantum.cs b/Validator/UnitTests/Test_BivalenceWorld_Quantum.cs similarity index 75% rename from Validator/UnitTests/Test_TarskiWorld_Quantum.cs rename to Validator/UnitTests/Test_BivalenceWorld_Quantum.cs index 1cd33ea..1d0d192 100644 --- a/Validator/UnitTests/Test_TarskiWorld_Quantum.cs +++ b/Validator/UnitTests/Test_BivalenceWorld_Quantum.cs @@ -8,12 +8,12 @@ namespace UnitTests { [TestClass] - public class Test_TarskiWorld_Quantum + public class Test_BivalenceWorld_Quantum { [TestMethod] public void TarskiWorld_AllQuantum() { - TarskiWorld world = new TarskiWorld(); + BivalenceWorld world = new BivalenceWorld(); List sentences = new List { "\u2200x Tet(x)", @@ -22,9 +22,9 @@ public void TarskiWorld_AllQuantum() }; List worldObjects = new List { - new WorldObject(new List { "a" }, new List {TarskiWorldDataFields.TET, TarskiWorldDataFields.LARGE }, new List {3, 3 }), - new WorldObject(new List { "b" }, new List {TarskiWorldDataFields.TET, TarskiWorldDataFields.MEDIUM }, new List {4, 4 }), - new WorldObject(new List { "" }, new List {TarskiWorldDataFields.TET, TarskiWorldDataFields.MEDIUM }, new List {2, 2 }) + new WorldObject(new List { "a" }, new List {BivalenceWorldDataFields.TET, BivalenceWorldDataFields.LARGE }, new List {3, 3 }), + new WorldObject(new List { "b" }, new List {BivalenceWorldDataFields.TET, BivalenceWorldDataFields.MEDIUM }, new List {4, 4 }), + new WorldObject(new List { "" }, new List {BivalenceWorldDataFields.TET, BivalenceWorldDataFields.MEDIUM }, new List {2, 2 }) }; WorldParameter parameter = new WorldParameter(worldObjects, sentences); var result = world.Check(parameter); @@ -39,7 +39,7 @@ public void TarskiWorld_AllQuantum() [TestMethod] public void TarskiWorld_ExistQuantum() { - TarskiWorld world = new TarskiWorld(); + BivalenceWorld world = new BivalenceWorld(); List sentences = new List { "\u2203x Tet(x)", @@ -49,9 +49,9 @@ public void TarskiWorld_ExistQuantum() }; List worldObjects = new List { - new WorldObject(new List { "a" }, new List {TarskiWorldDataFields.TET, TarskiWorldDataFields.LARGE }, new List {3, 3 }), - new WorldObject(new List { "b" }, new List {TarskiWorldDataFields.TET, TarskiWorldDataFields.MEDIUM }, new List {4, 4 }), - new WorldObject(new List { }, new List {TarskiWorldDataFields.CUBE, TarskiWorldDataFields.MEDIUM }, new List {2, 2 }) + new WorldObject(new List { "a" }, new List {BivalenceWorldDataFields.TET, BivalenceWorldDataFields.LARGE }, new List {3, 3 }), + new WorldObject(new List { "b" }, new List {BivalenceWorldDataFields.TET, BivalenceWorldDataFields.MEDIUM }, new List {4, 4 }), + new WorldObject(new List { }, new List {BivalenceWorldDataFields.CUBE, BivalenceWorldDataFields.MEDIUM }, new List {2, 2 }) }; WorldParameter parameter = new WorldParameter(worldObjects, sentences); var result = world.Check(parameter); diff --git a/Validator/UnitTests/Test_PL1_ConstPred_Constant.cs b/Validator/UnitTests/Test_PL1_ConstPred_Constant.cs index a1bdeb9..8f7472d 100644 --- a/Validator/UnitTests/Test_PL1_ConstPred_Constant.cs +++ b/Validator/UnitTests/Test_PL1_ConstPred_Constant.cs @@ -18,10 +18,10 @@ private WorldParameter CreateTestParmeter() { List worldObjects = new List { - new WorldObject(new List { "a", "c" }, new List {TarskiWorldDataFields.TET, TarskiWorldDataFields.LARGE }, null), - new WorldObject(new List { "b" }, new List {TarskiWorldDataFields.TET, TarskiWorldDataFields.SMALL }, null), - new WorldObject(new List { "d" }, new List {TarskiWorldDataFields.CUBE, TarskiWorldDataFields.LARGE }, null), - new WorldObject(new List { }, new List {TarskiWorldDataFields.CUBE }, null) + new WorldObject(new List { "a", "c" }, new List {BivalenceWorldDataFields.TET, BivalenceWorldDataFields.LARGE }, null), + new WorldObject(new List { "b" }, new List {BivalenceWorldDataFields.TET, BivalenceWorldDataFields.SMALL }, null), + new WorldObject(new List { "d" }, new List {BivalenceWorldDataFields.CUBE, BivalenceWorldDataFields.LARGE }, null), + new WorldObject(new List { }, new List {BivalenceWorldDataFields.CUBE }, null) }; return new WorldParameter(worldObjects, null); @@ -31,7 +31,7 @@ private WorldParameter CreateTestParmeter() [TestInitialize] public void PL1_Setup() { - TarskiWorld world = new TarskiWorld(); + BivalenceWorld world = new BivalenceWorld(); WorldParameter parameter = CreateTestParmeter(); world.Check(parameter); @@ -45,7 +45,7 @@ public void PL1_Setup() [TestMethod] public void PL1_Constants_True() { - TarskiWorld world = new TarskiWorld(); + BivalenceWorld world = new BivalenceWorld(); WorldParameter parameter = CreateTestParmeter(); world.Check(parameter); @@ -66,14 +66,14 @@ public void PL1_NoConstants() { List worldObjects = new List { - new WorldObject(new List { }, new List {TarskiWorldDataFields.TET, TarskiWorldDataFields.LARGE }, null), - new WorldObject(new List { "" }, new List {TarskiWorldDataFields.TET, TarskiWorldDataFields.SMALL }, null), - new WorldObject(new List { }, new List {TarskiWorldDataFields.CUBE, TarskiWorldDataFields.LARGE }, null), - new WorldObject(new List { }, new List {TarskiWorldDataFields.CUBE }, null) + new WorldObject(new List { }, new List {BivalenceWorldDataFields.TET, BivalenceWorldDataFields.LARGE }, null), + new WorldObject(new List { "" }, new List {BivalenceWorldDataFields.TET, BivalenceWorldDataFields.SMALL }, null), + new WorldObject(new List { }, new List {BivalenceWorldDataFields.CUBE, BivalenceWorldDataFields.LARGE }, null), + new WorldObject(new List { }, new List {BivalenceWorldDataFields.CUBE }, null) }; - TarskiWorld world = new TarskiWorld(); + BivalenceWorld world = new BivalenceWorld(); world.Check(new WorldParameter(worldObjects, null)); PL1Structure structure = world.GetPl1Structure(); @@ -89,16 +89,16 @@ public void PL1_NoConstants() [TestMethod] public void PL1_Predicates_ContainsKey_True() { - Assert.IsTrue(_predDictionary.ContainsKey(TarskiWorldDataFields.TET)); - Assert.IsTrue(_predDictionary.ContainsKey(TarskiWorldDataFields.LARGE)); - Assert.IsTrue(_predDictionary.ContainsKey(TarskiWorldDataFields.SMALL)); - Assert.IsTrue(_predDictionary.ContainsKey(TarskiWorldDataFields.CUBE)); + Assert.IsTrue(_predDictionary.ContainsKey(BivalenceWorldDataFields.TET)); + Assert.IsTrue(_predDictionary.ContainsKey(BivalenceWorldDataFields.LARGE)); + Assert.IsTrue(_predDictionary.ContainsKey(BivalenceWorldDataFields.SMALL)); + Assert.IsTrue(_predDictionary.ContainsKey(BivalenceWorldDataFields.CUBE)); } [TestMethod] public void PL1_Predicates_ContainsValue_True() { - List> consts = _predDictionary[TarskiWorldDataFields.TET]; + List> consts = _predDictionary[BivalenceWorldDataFields.TET]; Assert.IsTrue(consts.Any(c => c.Contains("u0"))); Assert.IsTrue(consts.Any(c => c.Contains("u1"))); diff --git a/Validator/UnitTests/Test_PL1_DynamicPred.cs b/Validator/UnitTests/Test_PL1_DynamicPred.cs index a95684f..004ef54 100644 --- a/Validator/UnitTests/Test_PL1_DynamicPred.cs +++ b/Validator/UnitTests/Test_PL1_DynamicPred.cs @@ -18,9 +18,9 @@ private WorldParameter CreateBiggerParameter() { List worldObjects = new List { - new WorldObject(new List { "a" }, new List {TarskiWorldDataFields.TET, TarskiWorldDataFields.LARGE }, null), - new WorldObject(new List { "b" }, new List {TarskiWorldDataFields.TET, TarskiWorldDataFields.MEDIUM }, null), - new WorldObject(new List { "c" }, new List {TarskiWorldDataFields.TET, TarskiWorldDataFields.SMALL }, null), + new WorldObject(new List { "a" }, new List {BivalenceWorldDataFields.TET, BivalenceWorldDataFields.LARGE }, null), + new WorldObject(new List { "b" }, new List {BivalenceWorldDataFields.TET, BivalenceWorldDataFields.MEDIUM }, null), + new WorldObject(new List { "c" }, new List {BivalenceWorldDataFields.TET, BivalenceWorldDataFields.SMALL }, null), }; return new WorldParameter(worldObjects, null); @@ -30,7 +30,7 @@ private WorldParameter CreateBiggerParameter() [TestInitialize] public void PL1_Setup() { - TarskiWorld world = new TarskiWorld(); + BivalenceWorld world = new BivalenceWorld(); WorldParameter parameter = CreateBiggerParameter(); world.Check(parameter); @@ -44,9 +44,9 @@ public void PL1_Setup() [TestMethod] public void PL1_PredBigger_True() { - Assert.IsTrue(_predDictionary.ContainsKey(TarskiWorldDataFields.LARGER)); + Assert.IsTrue(_predDictionary.ContainsKey(BivalenceWorldDataFields.LARGER)); - List> preds = _predDictionary[TarskiWorldDataFields.LARGER]; + List> preds = _predDictionary[BivalenceWorldDataFields.LARGER]; Assert.IsTrue(preds.Any(x => x[0] == "u0" && x[1] == "u1")); Assert.IsTrue(preds.Any(x => x[0] == "u0" && x[1] == "u2")); @@ -56,9 +56,9 @@ public void PL1_PredBigger_True() [TestMethod] public void PL1_PredSmaller_True() { - Assert.IsTrue(_predDictionary.ContainsKey(TarskiWorldDataFields.SMALLER)); + Assert.IsTrue(_predDictionary.ContainsKey(BivalenceWorldDataFields.SMALLER)); - List> preds = _predDictionary[TarskiWorldDataFields.SMALLER]; + List> preds = _predDictionary[BivalenceWorldDataFields.SMALLER]; Assert.IsTrue(preds.Any(x => x[0] == "u1" && x[1] == "u0")); Assert.IsTrue(preds.Any(x => x[0] == "u2" && x[1] == "u0")); From 04beb502227b5274d4a11db65aaa7cc1e939ae2b Mon Sep 17 00:00:00 2001 From: HanHan Date: Tue, 28 Jul 2020 15:48:42 +0200 Subject: [PATCH 8/8] setup travis, delete appveyor --- .travis.yml | 1 + Makefile | 6 - .../BivalenceWorld/BivalenceWorld.csproj | 5 + .../UnitTests/Test_BivalenceWorld_Equals.cs | 19 +-- .../UnitTests/Test_DiceGame/GameRuleSet.cs | 114 ------------------ .../UnitTests/Test_DiceGame/GameWorld.cs | 58 --------- .../Test_DiceGame/GameWorldFields.cs | 20 --- .../UnitTests/Test_DiceGame/NotEquals.cs | 27 ----- .../Test_DiceGame_Performance.cs | 31 ----- Validator/UnitTests/UnitTests.csproj | 5 + Validator/Validator/Validator.csproj | 10 +- appveyor.yml | 0 12 files changed, 26 insertions(+), 270 deletions(-) delete mode 100644 Makefile delete mode 100644 Validator/UnitTests/Test_DiceGame/GameRuleSet.cs delete mode 100644 Validator/UnitTests/Test_DiceGame/GameWorld.cs delete mode 100644 Validator/UnitTests/Test_DiceGame/GameWorldFields.cs delete mode 100644 Validator/UnitTests/Test_DiceGame/NotEquals.cs delete mode 100644 Validator/UnitTests/Test_DiceGame/Test_DiceGame_Performance.cs delete mode 100644 appveyor.yml diff --git a/.travis.yml b/.travis.yml index 424e1d0..8e9e125 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,4 +9,5 @@ jobs: script: - dotnet restore - dotnet build + - dotnet test \ No newline at end of file diff --git a/Makefile b/Makefile deleted file mode 100644 index ecb4c4b..0000000 --- a/Makefile +++ /dev/null @@ -1,6 +0,0 @@ -test: SHELL:=/bin/bash -test: - bash <(curl -fsSL https://raw.githubusercontent.com/neogeek/unity-ci-tools/v1.0.0/bin/test.sh) - -clean: - git clean -xdf \ No newline at end of file diff --git a/Validator/BivalenceWorld/BivalenceWorld.csproj b/Validator/BivalenceWorld/BivalenceWorld.csproj index 73ffdb1..fc4bca5 100644 --- a/Validator/BivalenceWorld/BivalenceWorld.csproj +++ b/Validator/BivalenceWorld/BivalenceWorld.csproj @@ -4,6 +4,11 @@ netstandard2.0 + + full + true + + diff --git a/Validator/UnitTests/Test_BivalenceWorld_Equals.cs b/Validator/UnitTests/Test_BivalenceWorld_Equals.cs index ab57387..f0aae1c 100644 --- a/Validator/UnitTests/Test_BivalenceWorld_Equals.cs +++ b/Validator/UnitTests/Test_BivalenceWorld_Equals.cs @@ -1,13 +1,14 @@ using System.Collections.Generic; +using Microsoft.VisualStudio.TestTools.UnitTesting; using Validator; using Validator.World; -using Xunit; namespace UnitTests { + [TestClass] public class Test_BivalenceWorld_Equals { - [Fact] + [TestMethod] public void TarskiWorld_Equals() { BivalenceWorld world = new BivalenceWorld(); @@ -26,12 +27,12 @@ public void TarskiWorld_Equals() WorldParameter parameter = new WorldParameter(worldObjects, sentences); var result = world.Check(parameter); - Assert.True(result.Result.Value[0].Value == EValidationResult.True); - Assert.True(result.Result.Value[1].Value == EValidationResult.True); - Assert.False(result.Result.Value[2].Value == EValidationResult.True); + Assert.IsTrue(result.Result.Value[0].Value == EValidationResult.True); + Assert.IsTrue(result.Result.Value[1].Value == EValidationResult.True); + Assert.IsFalse(result.Result.Value[2].Value == EValidationResult.True); } - [Fact] + [TestMethod] public void TarskiWorld_NotEquals() { BivalenceWorld world = new BivalenceWorld(); @@ -50,9 +51,9 @@ public void TarskiWorld_NotEquals() WorldParameter parameter = new WorldParameter(worldObjects, sentences); var result = world.Check(parameter); - Assert.True(result.Result.Value[0].Value == EValidationResult.True); - Assert.True(result.Result.Value[1].Value == EValidationResult.True); - Assert.False(result.Result.Value[2].Value == EValidationResult.True); + Assert.IsTrue(result.Result.Value[0].Value == EValidationResult.True); + Assert.IsTrue(result.Result.Value[1].Value == EValidationResult.True); + Assert.IsFalse(result.Result.Value[2].Value == EValidationResult.True); } } } diff --git a/Validator/UnitTests/Test_DiceGame/GameRuleSet.cs b/Validator/UnitTests/Test_DiceGame/GameRuleSet.cs deleted file mode 100644 index ddb48aa..0000000 --- a/Validator/UnitTests/Test_DiceGame/GameRuleSet.cs +++ /dev/null @@ -1,114 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -public class GameRuleSet -{ - private const string AllQuantum = "\u2200"; - private const string ExistQuantum = "\u2203"; - private const string Implication = "\u2192"; - private const string AND = "\u2227"; - private const string OR = "\u2228"; - - - public static List GetRule(ERule rule) - { - switch (rule) - { - case ERule.SelectionPossible: - return new List - { - $"{AllQuantum}x (Selected(x) {Implication} (" + - $"(DiceOne(x) {AND} {AllQuantum}y (NotEquals(x,y) {Implication} NotSelected(y)))" + - $"{OR} {ExistQuantum}y (DiceTwo(x) {AND} DiceTwo(y) {AND} NotEquals(x,y) {AND} {AllQuantum}u ((NotEquals(x,u) {AND} NotEquals(y,u)) {Implication} NotSelected(u)))" + - $"{OR} (DiceThree(x) {AND} {AllQuantum}y (NotEquals(x,y) {Implication} NotSelected(y)))" + - $"{OR} {ExistQuantum}y (DiceThree(x) {AND} DiceThree(y) {AND} NotEquals(x,y) {AND} {AllQuantum}u ((NotEquals(x,u) {AND} NotEquals(y,u)) {Implication} NotSelected(u)))" + - $"{OR} {ExistQuantum}y {ExistQuantum}z (DiceThree(x) {AND} DiceThree(y) {AND} DiceThree(z) {AND} NotEquals(x,y) {AND} NotEquals(x,z) {AND} NotEquals(y,z) {AND} {AllQuantum}u ((NotEquals(x,u) {AND} NotEquals(y,u) {AND} NotEquals(z,u)) {Implication} NotSelected(u)))" + - $"{OR} {ExistQuantum}y (DiceFour(x) {AND} DiceFour(y) {AND} NotEquals(x,y) {AND} {AllQuantum}u ((NotEquals(x,u) {AND} NotEquals(y,u)) {Implication} NotSelected(u)))" + - $"{OR} {ExistQuantum}y {ExistQuantum}z (DiceFour(x) {AND} DiceFour(y) {AND} DiceFour(z) {AND} NotEquals(x,y) {AND} NotEquals(x,z) {AND} NotEquals(y,z) {AND} {AllQuantum}u ((NotEquals(x,u) {AND} NotEquals(y,u) {AND} NotEquals(z,u)) {Implication} NotSelected(u)))" + - $"{OR} {ExistQuantum}y (DiceFive(x) {AND} DiceFive(y) {AND} NotEquals(x,y) {AND} {AllQuantum}u ((NotEquals(x,u) {AND} NotEquals(y,u)) {Implication} NotSelected(u)))" + - $"{OR} {ExistQuantum}y {ExistQuantum}z (DiceFive(x) {AND} DiceFive(y) {AND} DiceFive(z) {AND} NotEquals(x,y) {AND} NotEquals(x,z) {AND} NotEquals(y,z) {AND} {AllQuantum}u ((NotEquals(x,u) {AND} NotEquals(y,u) {AND} NotEquals(z,u)) {Implication} NotSelected(u)))" + - $"{OR} (DiceSix(x) {AND} {AllQuantum}y (NotEquals(x,y) {Implication} NotSelected(y)))))" - }; - case ERule.Dice1x1: - return new List - { - $"{ExistQuantum}x (Selected(x) {AND} DiceOne(x)" + - $"{AND} {AllQuantum}u (NotEquals(u,x) {Implication} NotSelected(u)))" - }; - case ERule.Dice2x2: - return new List - { - $"{ExistQuantum}x {ExistQuantum}y (Selected(x) {AND} Selected(y) {AND} NotEquals(x,y) {AND} DiceTwo(x) {AND} DiceTwo(y)" + - $"{AND} {AllQuantum}u ((NotEquals(u,x) {AND} NotEquals(u,y)) {Implication} NotSelected(u)))" - }; - case ERule.Dice1x3: - return new List - { - $"{ExistQuantum}x (Selected(x) {AND} DiceThree(x)" + - $"{AND} {AllQuantum}u (NotEquals(u,x) {Implication} NotSelected(u)))" - }; - case ERule.Dice2x3: - return new List - { - $"{ExistQuantum}x {ExistQuantum}y (Selected(x) {AND} Selected(y) {AND} NotEquals(x,y) {AND} DiceThree(x) {AND} DiceThree(y)" + - $"{AND} {AllQuantum}u ((NotEquals(u,x) {AND} NotEquals(u,y)) {Implication} NotSelected(u)))" - }; - case ERule.Dice3x3: - return new List - { - $"{ExistQuantum}x {ExistQuantum}y {ExistQuantum}z (Selected(x) {AND} Selected(y) {AND} Selected(z) {AND} NotEquals(x,y) {AND} NotEquals(x,z) {AND} DiceThree(x) {AND} DiceThree(y) {AND} DiceThree(z)" + - $"{AND} {AllQuantum}u ((NotEquals(u,x) {AND} NotEquals(u,y) {AND} NotEquals(u,z)) {Implication} NotSelected(u)))" - }; - case ERule.Dice2x4: - return new List - { - $"{ExistQuantum}x {ExistQuantum}y (Selected(x) {AND} Selected(y) {AND} NotEquals(x,y) {AND} DiceFour(x) {AND} DiceFour(y)" + - $"{AND} {AllQuantum}u ((NotEquals(u,x) {AND} NotEquals(u,y)) {Implication} NotSelected(u)))" - }; - case ERule.Dice3x4: - return new List - { - $"{ExistQuantum}x {ExistQuantum}y {ExistQuantum}z (Selected(x) {AND} Selected(y) {AND} Selected(z) {AND} NotEquals(x,y) {AND} NotEquals(x,z) {AND} DiceFour(x) {AND} DiceFour(y) {AND} DiceFour(z)" + - $"{AND} {AllQuantum}u ((NotEquals(u,x) {AND} NotEquals(u,y) {AND} NotEquals(u,z)) {Implication} NotSelected(u)))" - }; - case ERule.Dice2x5: - return new List - { - $"{ExistQuantum}x {ExistQuantum}y (Selected(x) {AND} Selected(y) {AND} NotEquals(x,y) {AND} DiceFive(x) {AND} DiceFive(y)" + - $"{AND} {AllQuantum}u ((NotEquals(u,x) {AND} NotEquals(u,y)) {Implication} NotSelected(u)))" - }; - case ERule.Dice3x5: - return new List - { - $"{ExistQuantum}x {ExistQuantum}y {ExistQuantum}z (Selected(x) {AND} Selected(y) {AND} Selected(z) {AND} NotEquals(x,y) {AND} NotEquals(x,z) {AND} NotEquals(y,z) {AND} DiceFive(x) {AND} DiceFive(y) {AND} DiceFive(z)" + - $"{AND} {AllQuantum}u ((NotEquals(u,x) {AND} NotEquals(u,y) {AND} NotEquals(u,z)) {Implication} NotSelected(u)))" - }; - case ERule.Dice1x6: - return new List - { - $"{ExistQuantum}x (Selected(x) {AND} DiceSix(x)" + - $"{AND} {AllQuantum}u (NotEquals(u,x) {Implication} NotSelected(u)))" - }; - default: - return new List() { }; - } - } - - public enum ERule - { - Dice1x1, - Dice2x2, - Dice1x3, - Dice2x3, - Dice3x3, - Dice2x4, - Dice3x4, - Dice2x5, - Dice3x5, - Dice1x6, - SelectionPossible - } -} diff --git a/Validator/UnitTests/Test_DiceGame/GameWorld.cs b/Validator/UnitTests/Test_DiceGame/GameWorld.cs deleted file mode 100644 index 45aadad..0000000 --- a/Validator/UnitTests/Test_DiceGame/GameWorld.cs +++ /dev/null @@ -1,58 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Validator; - - -public class GameWorld : AWorld -{ - protected override Dictionary CreateFunctionDictionary() - { - return new Dictionary - { - - }; - } - - protected override Dictionary CreatePredicateDictionary() - { - return new Dictionary - { - { GameWorldFields.NOTEQUALS, new NotEquals() } - }; - } - - protected override Signature CreateSignature() - { - return new Signature - { - Consts = new List - { - "1", - "2", - "3", - "4", - "5", - "6" - }, - Predicates = new List<(string, int)> - { - (GameWorldFields.DICEONE, 1), - (GameWorldFields.DICETWO, 1), - (GameWorldFields.DICETHREE, 1), - (GameWorldFields.DICEFOUR, 1), - (GameWorldFields.DICEFIVE, 1), - (GameWorldFields.DICESIX, 1), - (GameWorldFields.SELECTED, 1), - (GameWorldFields.NOTSELECTED, 1), - (GameWorldFields.NOTEQUALS, 2) - }, - Functions = new List<(string, int)> - { - - } - }; - } -} diff --git a/Validator/UnitTests/Test_DiceGame/GameWorldFields.cs b/Validator/UnitTests/Test_DiceGame/GameWorldFields.cs deleted file mode 100644 index 7899d03..0000000 --- a/Validator/UnitTests/Test_DiceGame/GameWorldFields.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -public static class GameWorldFields -{ - public const string DICEONE = "DiceOne"; - public const string DICETWO = "DiceTwo"; - public const string DICETHREE = "DiceThree"; - public const string DICEFOUR = "DiceFour"; - public const string DICEFIVE = "DiceFive"; - public const string DICESIX = "DiceSix"; - - public const string NOTEQUALS = "NotEquals"; - - public const string SELECTED = "Selected"; - public const string NOTSELECTED = "NotSelected"; -} diff --git a/Validator/UnitTests/Test_DiceGame/NotEquals.cs b/Validator/UnitTests/Test_DiceGame/NotEquals.cs deleted file mode 100644 index 8b33679..0000000 --- a/Validator/UnitTests/Test_DiceGame/NotEquals.cs +++ /dev/null @@ -1,27 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Validator; - -public class NotEquals : IPredicateValidation -{ - public bool Check(List obj) - { - if (obj.Count != 2) - { - throw new Exception("Invalid NotEquals Parameter"); - } - else - { - WorldObject o1 = obj[0]; - WorldObject o2 = obj[1]; - - string id1 = o1.Consts.FirstOrDefault(); - string id2 = o2.Consts.FirstOrDefault(); - - return id1 != id2; - } - } -} diff --git a/Validator/UnitTests/Test_DiceGame/Test_DiceGame_Performance.cs b/Validator/UnitTests/Test_DiceGame/Test_DiceGame_Performance.cs deleted file mode 100644 index 1fbeedf..0000000 --- a/Validator/UnitTests/Test_DiceGame/Test_DiceGame_Performance.cs +++ /dev/null @@ -1,31 +0,0 @@ -using System; -using System.Collections.Generic; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using Validator; -using Validator.World; - -namespace UnitTests.Test_DiceGame -{ - [TestClass] - public class Test_DiceGame_Performance - { - [TestMethod] - public void Test_Performance_LongSentence() - { - List worldObjects = new List - { - new WorldObject(new List { "1" }, new List {GameWorldFields.DICEONE , GameWorldFields.SELECTED }, new List()), - new WorldObject(new List { "2" }, new List {GameWorldFields.DICEONE , GameWorldFields.NOTSELECTED }, new List()), - new WorldObject(new List { "3" }, new List {GameWorldFields.DICETWO , GameWorldFields.NOTSELECTED }, new List()), - new WorldObject(new List { "4" }, new List {GameWorldFields.DICETHREE , GameWorldFields.NOTSELECTED }, new List()), - new WorldObject(new List { "5" }, new List {GameWorldFields.DICEFOUR , GameWorldFields.NOTSELECTED }, new List()), - new WorldObject(new List { "6" }, new List {GameWorldFields.DICESIX , GameWorldFields.NOTSELECTED }, new List()) - }; - - AWorld world = new GameWorld(); - var result = world.Check(new WorldParameter(worldObjects, GameRuleSet.GetRule(GameRuleSet.ERule.SelectionPossible))); - - Assert.IsTrue(result.Result.Value[0].Value == EValidationResult.True); - } - } -} diff --git a/Validator/UnitTests/UnitTests.csproj b/Validator/UnitTests/UnitTests.csproj index cf3ca8e..dba1b10 100644 --- a/Validator/UnitTests/UnitTests.csproj +++ b/Validator/UnitTests/UnitTests.csproj @@ -6,6 +6,11 @@ false + + full + true + + diff --git a/Validator/Validator/Validator.csproj b/Validator/Validator/Validator.csproj index ec8d6bc..e7852b0 100644 --- a/Validator/Validator/Validator.csproj +++ b/Validator/Validator/Validator.csproj @@ -4,14 +4,14 @@ netstandard2.0 + + full + true + + - - - all - runtime; build; native; contentfiles; analyzers - diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index e69de29..0000000