Skip to content

Commit

Permalink
feat: add dummy class and test for setting up testing pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
QuakeEye committed Feb 27, 2024
1 parent 7e4bd6b commit 191497b
Show file tree
Hide file tree
Showing 10 changed files with 111 additions and 0 deletions.
8 changes: 8 additions & 0 deletions aplib.net-demo/Assets/Scripts/PipelineTesting.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions aplib.net-demo/Assets/Scripts/PipelineTesting/Calculator.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Calculator : MonoBehaviour
{
public static int Add(int a, int b)
{
int c = a + b;
return c;
}
}
11 changes: 11 additions & 0 deletions aplib.net-demo/Assets/Scripts/PipelineTesting/Calculator.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions aplib.net-demo/Assets/Scripts/Scripts.asmdef
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"name": "Scripts"
}
7 changes: 7 additions & 0 deletions aplib.net-demo/Assets/Scripts/Scripts.asmdef.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions aplib.net-demo/Assets/Testing/EditModeTests.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions aplib.net-demo/Assets/Testing/EditModeTests/CalculatorTests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
using NUnit.Framework;

public class NewTestScript
{
[Test]
[TestCase(5, 10, 15)]
[TestCase(-2, 7, 5)]
[TestCase(0, 0, 0)]
public void Calculator_Addition(int a, int b, int expected)
{
// Arrange
// Handled in testcases

// Act
int result = Calculator.Add(a, b);

// Assert
Assert.AreEqual(expected, result);
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 24 additions & 0 deletions aplib.net-demo/Assets/Testing/EditModeTests/EditModeTests.asmdef
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"name": "EditModeTests",
"rootNamespace": "",
"references": [
"UnityEngine.TestRunner",
"UnityEditor.TestRunner",
"Scripts"
],
"includePlatforms": [
"Editor"
],
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": true,
"precompiledReferences": [
"nunit.framework.dll"
],
"autoReferenced": false,
"defineConstraints": [
"UNITY_INCLUDE_TESTS"
],
"versionDefines": [],
"noEngineReferences": false
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 191497b

Please sign in to comment.