Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
2
20230403
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Patryk Czarnik
20230403
Commits
c6d1160f
Commit
c6d1160f
authored
Apr 03, 2023
by
Patryk Czarnik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Klasa Konto i pierwsze testy
parent
83a5faf6
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
57 additions
and
0 deletions
+57
-0
.classpath
PC21-Watki/.classpath
+1
-0
Konto.java
PC21-Watki/src/konto/Konto.java
+36
-0
KontoTest.java
PC21-Watki/src/konto/KontoTest.java
+20
-0
No files found.
PC21-Watki/.classpath
View file @
c6d1160f
...
@@ -6,5 +6,6 @@
...
@@ -6,5 +6,6 @@
</attributes>
</attributes>
</classpathentry>
</classpathentry>
<classpathentry
kind=
"src"
path=
"src"
/>
<classpathentry
kind=
"src"
path=
"src"
/>
<classpathentry
kind=
"con"
path=
"org.eclipse.jdt.junit.JUNIT_CONTAINER/5"
/>
<classpathentry
kind=
"output"
path=
"bin"
/>
<classpathentry
kind=
"output"
path=
"bin"
/>
</classpath>
</classpath>
PC21-Watki/src/konto/Konto.java
0 → 100644
View file @
c6d1160f
package
konto
;
public
class
Konto
{
private
final
int
numer
;
private
final
String
wlasciciel
;
private
int
saldo
;
public
Konto
(
int
numer
,
String
wlasciciel
,
int
saldo
)
{
this
.
numer
=
numer
;
this
.
wlasciciel
=
wlasciciel
;
this
.
saldo
=
saldo
;
}
public
Konto
(
int
numer
,
String
wlasciciel
)
{
this
(
numer
,
wlasciciel
,
0
);
}
public
int
getNumer
()
{
return
numer
;
}
public
String
getWlasciciel
()
{
return
wlasciciel
;
}
public
int
getSaldo
()
{
return
saldo
;
}
@Override
public
String
toString
()
{
return
"Konto nr "
+
numer
+
", wł. "
+
wlasciciel
+
", saldo "
+
saldo
;
}
}
PC21-Watki/src/konto/KontoTest.java
0 → 100644
View file @
c6d1160f
package
konto
;
import
static
org
.
junit
.
jupiter
.
api
.
Assertions
.*;
import
org.junit.jupiter.api.BeforeEach
;
import
org.junit.jupiter.api.Test
;
class
KontoTest
{
@BeforeEach
void
setUp
()
throws
Exception
{
}
@Test
void
testToString
()
{
Konto
konto
=
new
Konto
(
123
,
"Ala Kowalska"
,
1200
);
assertEquals
(
"Konto nr 123, wł. Ala Kowalska, saldo 1200"
,
konto
.
toString
());
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment