Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
testDemo
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SOFT Core
SOFT 160
testDemo
Commits
a63d693f
Commit
a63d693f
authored
3 years ago
by
Christopher Bohn
Browse files
Options
Downloads
Patches
Plain Diff
Added integer version of multiplyByTen
parent
1544b464
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/java/edu/unl/edu/soft160/testDemo/TestDemoTarget.java
+9
-0
9 additions, 0 deletions
...ain/java/edu/unl/edu/soft160/testDemo/TestDemoTarget.java
src/test/java/edu/unl/edu/soft160/testDemo/TestDemoTests.java
+11
-0
11 additions, 0 deletions
...test/java/edu/unl/edu/soft160/testDemo/TestDemoTests.java
with
20 additions
and
0 deletions
src/main/java/edu/unl/edu/soft160/testDemo/TestDemoTarget.java
+
9
−
0
View file @
a63d693f
...
...
@@ -23,6 +23,15 @@ public class TestDemoTarget {
return
returnValue
;
}
public
static
int
multiplyByTen
(
int
multiplicand
)
{
double
multiplier
=
0.0
;
for
(
int
i
=
0
;
i
<
100
;
i
++)
{
multiplier
+=
0.1
;
}
double
product
=
multiplicand
*
multiplier
;
return
(
int
)
product
;
}
public
static
double
multiplyByTen
(
double
multiplicand
)
{
double
multiplier
=
0.0
;
for
(
int
i
=
0
;
i
<
100
;
i
++)
{
...
...
This diff is collapsed.
Click to expand it.
src/test/java/edu/unl/edu/soft160/testDemo/TestDemoTests.java
+
11
−
0
View file @
a63d693f
...
...
@@ -4,6 +4,17 @@ import org.junit.Test;
import
static
org
.
junit
.
Assert
.*;
public
class
TestDemoTests
{
@Test
public
void
testMultiplyZero
()
{
// arrange
int
value
=
0
;
int
expectedResult
=
0
;
// act
int
actualResult
=
TestDemoTarget
.
multiplyByTen
(
value
);
// assert
assertEquals
(
expectedResult
,
actualResult
);
}
@Test
public
void
testIntegerFirstValueIsGreater
()
{
// arrange
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment