first commit

This commit is contained in:
lethanhsonvsp
2025-11-17 15:36:52 +07:00
commit 6f2eafa33c
14093 changed files with 1253472 additions and 0 deletions

View File

@@ -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
}

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: f76c93a6c81bcd34d891082d352680f0
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 202460d24233ca14885ddef0738ff39c
AssemblyDefinitionImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -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
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 80f70419e25190e42bf12dc48af44cec
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: f9700b1234c8ac84baef75316d792496
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -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));
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: ad179a97039abe4438e6e25feb3dc143
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -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": []
}

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: a6d528d500982a84884a4e18b4d4122b
AssemblyDefinitionImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant: