Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
SWEN90006-A1-2019
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
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
Tim Miller
SWEN90006-A1-2019
Merge requests
!12
Update BoundaryTests.java
Code
Review changes
Check out branch
Download
Patches
Plain diff
Open
Update BoundaryTests.java
XCC2/swen90006-a1-2019:patch-2
into
master
Overview
0
Commits
1
Pipelines
0
Changes
1
Open
Xi Chen
requested to merge
XCC2/swen90006-a1-2019:patch-2
into
master
5 years ago
Overview
0
Commits
1
Pipelines
0
Changes
1
Expand
0
0
Merge request reports
Compare
master
master (HEAD)
and
latest version
latest version
caf28c6e
1 commit,
5 years ago
1 file
+
33
−
19
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
tests/Boundary/swen90006/passbook/BoundaryTests.java
+
33
−
19
Options
package
swen90006.passbook
;
import
java.util.List
;
import
java.util.ArrayList
;
import
java.nio.charset.Charset
;
import
java.nio.file.Path
;
import
java.nio.file.Files
;
import
java.nio.file.FileSystems
;
import
static
org
.
junit
.
Assert
.
assertTrue
;
import
static
org
.
junit
.
jupiter
.
api
.
Assertions
.
assertThrows
;
import
org.junit.*
;
import
static
org
.
junit
.
Assert
.*;
import
java.net.MalformedURLException
;
import
java.net.URL
;
import
org.junit.Test
;
//By extending PartitioningTests, we inherit tests from the script
public
class
BoundaryTests
extends
PartitioningTests
{
//Add another test
@Test
public
void
anotherTEst
()
{
//include a message for better feedback
final
int
expected
=
2
;
final
int
actual
=
2
;
assertEquals
(
"Some failure message"
,
expected
,
actual
);
}
public
class
BoundaryTests
extends
PartitioningTests
{
/*
* Test cases for addUser
*/
@Test
public
void
testPassphraseLength
()
{
// EC 1.2
assertThrows
(
WeakPassphraseException
.
class
,
()
->
pb
.
addUser
(
"456abc"
,
"0234569"
));
}
@Test
public
void
testWeakPassphrase
()
throws
DuplicateUserException
,
WeakPassphraseException
{
pb
.
addUser
(
"456abc"
,
"az0129AZ"
);
assertTrue
(
pb
.
isUser
(
"456abc"
));
}
/*
* Test cases for updateDetails
*/
@Test
public
void
testDetailsNUll
()
throws
MalformedURLException
,
InvalidSessionIDException
,
NoSuchURLException
{
URL
url
=
new
URL
(
"https://students.com"
);
pb
.
updateDetails
(
sessionID
,
url
,
"Xi"
,
null
);
assertThrows
(
NoSuchURLException
.
class
,
()
->
pb
.
retrieveDetails
(
sessionID
,
url
));
}
}
Loading