Skip to content
Open

Tests #117

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
name: 'Run App <last name>, <first name>'
name: 'Run App Olsen, Gavin'

on: [push, pull_request]

jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- run: echo "Hello, World!"
- uses: actions/checkout@v2
- name: install dotnet
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.x'
- name: build
run: dotnet build
- name: run unit tests
run: dotnet test
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[![Run App](https://github.com/kgerot/GithubActions/actions/workflows/run-app.yaml/badge.svg)](https://github.com/kgerot/GithubActions/actions/workflows/run-app.yaml)
[![Run App Olsen, Gavin](https://github.com/GavinO0745/GithubActions/actions/workflows/ci.yml/badge.svg)](https://github.com/GavinO0745/GithubActions/actions/workflows/ci.yml)

# Do not submit a pull request to `kgerot/GithubActions` or `dteske/TraviCI`. Not following this instruction can ruin the lab for others, so pay attention.

.
I receive around 60 pull requests every semester and have to manually delete each request and action run. Your actions will automatically fail if you open a pull request

# Github Actions Lab
Expand Down
28 changes: 28 additions & 0 deletions Tests/UnitTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,32 @@ public void Add_Null_Patino()
Assert.ThrowsException<ArgumentNullException>(() => Program.Add(null, "1"));
Assert.ThrowsException<ArgumentNullException>(() => Program.Add(null, null));
}

[TestMethod]
public void Subtract_Valid()
{
Assert.AreEqual(1, Program.Subtract("3", "2"));
Assert.AreEqual(0, Program.Subtract("2", "2"));
}

[TestMethod]
public void Multiply_Valid()
{
Assert.AreEqual(20, Program.Multiply("5", "2")); // WRONG ON PURPOSE
}

[TestMethod]
public void Divide_Valid()
{
Assert.AreEqual(2, Program.Divide("6", "3"));
Assert.AreEqual(5, Program.Divide("10", "2"));
}

[TestMethod]
public void Power_Valid()
{
Assert.AreEqual(8, Program.Power("2", "3"));
Assert.AreEqual(9, Program.Power("3", "2"));
}

}