Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
idatt1002
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
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
Surya Bahadur Kathayat
idatt1002
Commits
58e5f65f
Commit
58e5f65f
authored
2 years ago
by
surkat
Browse files
Options
Downloads
Patches
Plain Diff
created a new branch for login
parent
275dea65
No related branches found
No related tags found
No related merge requests found
Pipeline
#198214
passed
2 years ago
Stage: build
Stage: test
Stage: package
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/java/no/ntnu/idatt1002/demo/data/Account.java
+20
-0
20 additions, 0 deletions
src/main/java/no/ntnu/idatt1002/demo/data/Account.java
src/test/java/no/ntnu/idatt1002/demo/data/AcoountTest.java
+25
-0
25 additions, 0 deletions
src/test/java/no/ntnu/idatt1002/demo/data/AcoountTest.java
with
45 additions
and
0 deletions
src/main/java/no/ntnu/idatt1002/demo/data/Account.java
0 → 100644
+
20
−
0
View file @
58e5f65f
package
no.ntnu.idatt1002.demo.data
;
public
class
Account
{
private
String
name
;
private
double
balance
;
public
Account
(
final
String
name
)
{
this
.
name
=
name
;
}
public
boolean
deposit
(
double
amount
)
{
if
(
amount
>
0
)
{
balance
+=
amount
;
return
true
;
}
else
{
return
false
;
}
}
}
This diff is collapsed.
Click to expand it.
src/test/java/no/ntnu/idatt1002/demo/data/AcoountTest.java
0 → 100644
+
25
−
0
View file @
58e5f65f
package
no.ntnu.idatt1002.demo.data
;
import
org.junit.jupiter.api.Test
;
import
static
org
.
junit
.
jupiter
.
api
.
Assertions
.
assertFalse
;
import
static
org
.
junit
.
jupiter
.
api
.
Assertions
.
assertTrue
;
public
class
AcoountTest
{
@Test
public
void
testThatAccountDepositSucceed
()
{
Account
account
=
new
Account
(
"demosinkonto"
);
assertTrue
(
account
.
deposit
(
100
))
;
}
@Test
public
void
testThatAccountDepositFeil
()
{
Account
account
=
new
Account
(
"demosinkonto"
);
assertFalse
(
account
.
deposit
(-
100
))
;
}
}
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