From f0b5c319d835bd13267ea360e4e3bc146285d384 Mon Sep 17 00:00:00 2001 From: Chikashi Miyama Date: Sun, 30 Jun 2019 14:34:32 +0200 Subject: [PATCH] add first unit test --- CylVision/Assets/Scripts/UnitTest.meta | 8 +++++ .../Assets/Scripts/UnitTest/SimpleTest.cs | 32 +++++++++++++++++++ .../Scripts/UnitTest/SimpleTest.cs.meta | 11 +++++++ .../Assets/Scripts/UnitTest/UnitTest.asmdef | 9 ++++++ .../Scripts/UnitTest/UnitTest.asmdef.meta | 7 ++++ 5 files changed, 67 insertions(+) create mode 100644 CylVision/Assets/Scripts/UnitTest.meta create mode 100644 CylVision/Assets/Scripts/UnitTest/SimpleTest.cs create mode 100644 CylVision/Assets/Scripts/UnitTest/SimpleTest.cs.meta create mode 100644 CylVision/Assets/Scripts/UnitTest/UnitTest.asmdef create mode 100644 CylVision/Assets/Scripts/UnitTest/UnitTest.asmdef.meta diff --git a/CylVision/Assets/Scripts/UnitTest.meta b/CylVision/Assets/Scripts/UnitTest.meta new file mode 100644 index 0000000..e63e402 --- /dev/null +++ b/CylVision/Assets/Scripts/UnitTest.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: dd84b1e282004314588e2eaef1f6b744 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/CylVision/Assets/Scripts/UnitTest/SimpleTest.cs b/CylVision/Assets/Scripts/UnitTest/SimpleTest.cs new file mode 100644 index 0000000..168321f --- /dev/null +++ b/CylVision/Assets/Scripts/UnitTest/SimpleTest.cs @@ -0,0 +1,32 @@ +using NUnit.Framework; +using NSubstitute; + +namespace UnitTests +{ + public class SimpleTest + { + [Test] + public void FirstTest() + { + Assert.AreEqual(10, 10); + } + + public interface ISomeInterface + { + void doSomething(); + } + + [Test] + public void FirstMock() + { + var mock = Substitute.For(); + mock.doSomething(); + + mock.Received(1).doSomething(); + } + + + } + +} + diff --git a/CylVision/Assets/Scripts/UnitTest/SimpleTest.cs.meta b/CylVision/Assets/Scripts/UnitTest/SimpleTest.cs.meta new file mode 100644 index 0000000..bacf45b --- /dev/null +++ b/CylVision/Assets/Scripts/UnitTest/SimpleTest.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: cdafcc2692d5b5242b4a0a503324c76e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/CylVision/Assets/Scripts/UnitTest/UnitTest.asmdef b/CylVision/Assets/Scripts/UnitTest/UnitTest.asmdef new file mode 100644 index 0000000..753cb31 --- /dev/null +++ b/CylVision/Assets/Scripts/UnitTest/UnitTest.asmdef @@ -0,0 +1,9 @@ +{ + "name": "UnitTest", + "optionalUnityReferences": [ + "TestAssemblies" + ], + "includePlatforms": [ + "Editor" + ] +} \ No newline at end of file diff --git a/CylVision/Assets/Scripts/UnitTest/UnitTest.asmdef.meta b/CylVision/Assets/Scripts/UnitTest/UnitTest.asmdef.meta new file mode 100644 index 0000000..4abba3f --- /dev/null +++ b/CylVision/Assets/Scripts/UnitTest/UnitTest.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: d3e3873ca3daaac4f91b7c99dad940c3 +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: