Terms of Service
|
Privacy Policy
|
Cookie Policy
Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
R
random-barcode
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Package Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
sw4j-org
random-barcode
Commits
1f237746
Verified
Commit
1f237746
authored
Jan 13, 2020
by
Uwe Plonus
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added tests for setting encoding
parent
a305a5e6
Pipeline
#1363
passed with stages
in 20 minutes and 5 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
3 deletions
+25
-3
src/test/java/org/sw4j/tool/barcode/random/config/GenerationConfigNGTest.java
...4j/tool/barcode/random/config/GenerationConfigNGTest.java
+25
-3
No files found.
src/test/java/org/sw4j/tool/barcode/random/config/GenerationConfigNGTest.java
View file @
1f237746
...
...
@@ -52,21 +52,28 @@ public class GenerationConfigNGTest {
}
@Test
public
void
testSetSizeIsF
uil
d
()
{
public
void
testSetSizeIsF
lui
d
()
{
GenerationConfig
.
Builder
builder
=
GenerationConfig
.
builder
();
GenerationConfig
.
Builder
b
=
builder
.
setSize
(
128
);
assertNotNull
(
b
,
"Expected a builder to be returned by setSize."
);
}
@Test
public
void
testSetQrcodesIsFuild
()
{
public
void
testSetEncodingIsFluid
()
{
GenerationConfig
.
Builder
builder
=
GenerationConfig
.
builder
();
GenerationConfig
.
Builder
b
=
builder
.
setEncoding
(
EncodingConfig
.
builder
().
setType
(
"dummy"
).
build
());
assertNotNull
(
b
,
"Expected a builder to be returned by setEncoding."
);
}
@Test
public
void
testSetQrcodesIsFluid
()
{
GenerationConfig
.
Builder
builder
=
GenerationConfig
.
builder
();
GenerationConfig
.
Builder
b
=
builder
.
setCodes
(
Collections
.
EMPTY_LIST
);
assertNotNull
(
b
,
"Expected a builder to be returned by setQrcodes."
);
}
@Test
public
void
testSetEncodingsIsF
uil
d
()
{
public
void
testSetEncodingsIsF
lui
d
()
{
GenerationConfig
.
Builder
builder
=
GenerationConfig
.
builder
();
GenerationConfig
.
Builder
b
=
builder
.
setEncodings
(
Collections
.
EMPTY_LIST
);
assertNotNull
(
b
,
"Expected a builder to be returned by setEncodings."
);
...
...
@@ -220,4 +227,19 @@ public class GenerationConfigNGTest {
assertFalse
(
config
.
getEncodings
().
isEmpty
(),
"Expected the encodings not to be empty."
);
}
@Test
public
void
testBuildingPredefinedEncoding
()
{
GenerationConfig
.
Builder
builder
=
GenerationConfig
.
builder
();
GenerationConfig
.
Builder
b
=
builder
.
setSize
(
8
);
b
=
b
.
setEncoding
(
EncodingConfig
.
builder
().
setType
(
"base64"
).
build
());
b
=
b
.
setCodes
(
Collections
.
singletonList
(
CodeConfig
.
builder
()
.
setType
(
"qrcode"
)
.
setEncoding
(
EncodingConfig
.
builder
().
setType
(
"hex"
).
build
())
.
setUrl
(
"https://example.org/{code}"
)
.
build
()));
b
=
b
.
setEncodings
(
Collections
.
singletonList
(
EncodingConfig
.
builder
().
setType
(
"base58"
).
build
()));
GenerationConfig
config
=
b
.
build
();
assertFalse
(
config
.
getEncodings
().
isEmpty
(),
"Expected the encodings not to be empty."
);
}
}
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