diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 64db9d16..50915586 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,4 @@ -name: 'Run App , ' +name: 'Run App Olsen, Gavin' on: [push, pull_request] @@ -6,4 +6,12 @@ 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 diff --git a/README.md b/README.md index 7400b87d..0c46c7b9 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/Tests/UnitTests.cs b/Tests/UnitTests.cs index a2d3bd18..e71e7975 100644 --- a/Tests/UnitTests.cs +++ b/Tests/UnitTests.cs @@ -26,4 +26,32 @@ public void Add_Null_Patino() Assert.ThrowsException(() => Program.Add(null, "1")); Assert.ThrowsException(() => 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")); +} + }