This commit is contained in:
2025-01-17 13:10:42 +01:00
commit 4536213c91
15115 changed files with 1442174 additions and 0 deletions

View File

@@ -0,0 +1,5 @@
{
"displayName": "Exercise 3: Solution",
"description": "You will be introduced to the Assert.That and related classes.",
"interactiveImport": true
}

View File

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

View File

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

View File

@@ -0,0 +1,22 @@
using System.Linq;
namespace MyExercise_3s
{
public class ValueOutputter
{
public string GetString()
{
return "A string to be asserted on";
}
public int GetInt()
{
return 11;
}
public float GetFloat()
{
return 19f + (1f/3f);
}
}
}

View File

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

View File

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

View File

@@ -0,0 +1,22 @@
{
"name": "Tests_3s",
"references": [
"UnityEngine.TestRunner",
"UnityEditor.TestRunner",
"MyExercise_3s"
],
"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: 1dd3b07f0f04bdc47b29fce11a6b738f
AssemblyDefinitionImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,38 @@
using MyExercise_3s;
using NUnit.Framework;
namespace Tests_3s
{
internal class ValueOutputterTests
{
[Test]
public void GivesExpectedInt()
{
var outputterUnderTest = new ValueOutputter();
var number = outputterUnderTest.GetInt();
Assert.That(number, Is.EqualTo(11));
}
[Test]
public void GivesExpectedString()
{
var outputterUnderTest = new ValueOutputter();
var str = outputterUnderTest.GetString();
Assert.That(str, Does.Contain("string").And.Contain("asserted"));
}
[Test]
public void GivesExpectedFloat()
{
var outputterUnderTest = new ValueOutputter();
var number = outputterUnderTest.GetFloat();
Assert.That(number, Is.GreaterThan(19.33f).And.LessThan(19.34f));
}
}
}

View File

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