Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create CaluculatorTest.java #1

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
13 changes: 13 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: First Workflow
on: [push]

jobs:
run-shell-commands:
runs-on: ubuntu-latest
steps:
- name: echo a string
run: echo "Hello World"
- name: Multiline Command
run: |
node -v
npm -v
26 changes: 26 additions & 0 deletions src/test/java/com/scalesec/vulnado/CaluculatorTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
#Added a Java Test File for Demonstration of Code Coverage Percentage update on SonarCloud Dashboard
#By ASecurityGuru
*/

import static org.junit.Assert.assertEquals;
import org.junit.Test;

public class CalculatorTest {

@Test
public void verifyAdditionOne() {

Calculator calculator = new Calculator();
int sum = calculator.addition("5+2");
assertEquals(7, sum);
}

@Test
public void verifyAdditionTwo() {

Calculator calculator = new Calculator();
int sum = calculator.addition("13+27");
assertEquals(40, sum);
}
}