Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
permission_handler
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
songyanzhi
permission_handler
Commits
beb8e09d
Commit
beb8e09d
authored
Apr 13, 2021
by
Maurits van Beusekom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added tests for equality operator
parent
453624a1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
55 additions
and
0 deletions
+55
-0
permission_handler_platform_interface/test/src/permissions_test.dart
+55
-0
No files found.
permission_handler_platform_interface/test/src/permissions_test.dart
View file @
beb8e09d
...
...
@@ -22,4 +22,59 @@ void main() {
var
permissionName
=
permissionWithService
.
toString
();
expect
(
permissionName
,
'Permission.calendar'
);
});
test
(
// ignore: lines_longer_than_80_chars
'equality operator should return true for two instances with the same values'
,
()
{
// Arrange
final
firstPermission
=
Permission
.
byValue
(
1
);
final
secondPermission
=
Permission
.
byValue
(
1
);
// Act & Assert
expect
(
firstPermission
==
secondPermission
,
true
,
);
});
test
(
// ignore: lines_longer_than_80_chars
'equality operator should return false for two instances with different values'
,
()
{
// Arrange
final
firstPermission
=
Permission
.
byValue
(
1
);
final
secondPermission
=
Permission
.
byValue
(
2
);
// Act & Assert
expect
(
firstPermission
==
secondPermission
,
false
,
);
});
test
(
'hashCode should be the same for two instances with the same values'
,
()
{
// Arrange
final
firstPermission
=
Permission
.
byValue
(
1
);
final
secondPermission
=
Permission
.
byValue
(
1
);
// Act & Assert
expect
(
firstPermission
.
hashCode
,
secondPermission
.
hashCode
,
);
});
test
(
'hashCode should not match for two instances with different values'
,
()
{
// Arrange
final
firstPermission
=
Permission
.
byValue
(
1
);
final
secondPermission
=
Permission
.
byValue
(
2
);
// Act & Assert
expect
(
firstPermission
.
hashCode
!=
secondPermission
.
hashCode
,
true
,
);
});
}
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