add first unit test
This commit is contained in:
parent
8e0d7640d4
commit
f0b5c319d8
5 changed files with 67 additions and 0 deletions
8
CylVision/Assets/Scripts/UnitTest.meta
Normal file
8
CylVision/Assets/Scripts/UnitTest.meta
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: dd84b1e282004314588e2eaef1f6b744
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
32
CylVision/Assets/Scripts/UnitTest/SimpleTest.cs
Normal file
32
CylVision/Assets/Scripts/UnitTest/SimpleTest.cs
Normal file
|
@ -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<ISomeInterface>();
|
||||||
|
mock.doSomething();
|
||||||
|
|
||||||
|
mock.Received(1).doSomething();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
11
CylVision/Assets/Scripts/UnitTest/SimpleTest.cs.meta
Normal file
11
CylVision/Assets/Scripts/UnitTest/SimpleTest.cs.meta
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: cdafcc2692d5b5242b4a0a503324c76e
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
9
CylVision/Assets/Scripts/UnitTest/UnitTest.asmdef
Normal file
9
CylVision/Assets/Scripts/UnitTest/UnitTest.asmdef
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
{
|
||||||
|
"name": "UnitTest",
|
||||||
|
"optionalUnityReferences": [
|
||||||
|
"TestAssemblies"
|
||||||
|
],
|
||||||
|
"includePlatforms": [
|
||||||
|
"Editor"
|
||||||
|
]
|
||||||
|
}
|
7
CylVision/Assets/Scripts/UnitTest/UnitTest.asmdef.meta
Normal file
7
CylVision/Assets/Scripts/UnitTest/UnitTest.asmdef.meta
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: d3e3873ca3daaac4f91b7c99dad940c3
|
||||||
|
AssemblyDefinitionImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
Loading…
Reference in a new issue