Initial commit
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"displayName": "Exercise 1: Solution",
|
||||
"description": "This exercise will teach you how to set up a simple Unity project with a test assembly and tests.",
|
||||
"interactiveImport": true
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f76c93a6c81bcd34d891082d352680f0
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"name": "MyExercise_1s"
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 202460d24233ca14885ddef0738ff39c
|
||||
AssemblyDefinitionImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,16 @@
|
||||
|
||||
namespace MyExercise_1s
|
||||
{
|
||||
public static class MyMath
|
||||
{
|
||||
public static int Add(int a, int b)
|
||||
{
|
||||
return a + b;
|
||||
}
|
||||
|
||||
public static int Subtract(int a, int b)
|
||||
{
|
||||
return a - b; // Fixed
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 80f70419e25190e42bf12dc48af44cec
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f9700b1234c8ac84baef75316d792496
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,32 @@
|
||||
using MyExercise_1s;
|
||||
using NUnit.Framework;
|
||||
|
||||
namespace Tests_1s
|
||||
{
|
||||
public class MyMathTests
|
||||
{
|
||||
[Test]
|
||||
public void AddsTwoPositiveIntegers()
|
||||
{
|
||||
Assert.AreEqual(3, MyMath.Add(1, 2));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void AddAPositiveAndNegativeInteger()
|
||||
{
|
||||
Assert.AreEqual(1, MyMath.Add(3, -2));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void SubtractAPositiveInteger()
|
||||
{
|
||||
Assert.AreEqual(3, MyMath.Subtract(5, 2));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void SubtractANegativeInteger()
|
||||
{
|
||||
Assert.AreEqual(7, MyMath.Subtract(5, -2));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ad179a97039abe4438e6e25feb3dc143
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"name": "Tests_1s",
|
||||
"references": [
|
||||
"UnityEngine.TestRunner",
|
||||
"UnityEditor.TestRunner",
|
||||
"MyExercise_1s"
|
||||
],
|
||||
"includePlatforms": [
|
||||
"Editor"
|
||||
],
|
||||
"excludePlatforms": [],
|
||||
"allowUnsafeCode": false,
|
||||
"overrideReferences": true,
|
||||
"precompiledReferences": [
|
||||
"nunit.framework.dll"
|
||||
],
|
||||
"autoReferenced": true,
|
||||
"defineConstraints": [
|
||||
"UNITY_INCLUDE_TESTS"
|
||||
],
|
||||
"versionDefines": []
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a6d528d500982a84884a4e18b4d4122b
|
||||
AssemblyDefinitionImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user