MockSuperuser class final
Replicate behaviour of SuperuserInterface, which fulfilled requirements of testing.
It is ideal for widget testing that it can simulate
superuser status without
"Run as administrator"
for Windows, sudo for most UNIX system
or prompting polkit
for common desktop environments of Linux distros.
- Implemented types
Constructors
-
MockSuperuser({bool isSuperuser = false, bool isActivated = false, String whoAmI = "", Set<
String> groups = const {}, int matchingFlag = OSString.DEFAULT_MATCH}) - Create mocked properties of SuperuserInterface to emulate superuser status.
Properties
- groups → OSStringsSet
-
Obtains all groups name that this user is associated.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- isActivated → bool
-
Determine this program is executed with superuser right.
final
- isSuperuser → bool
-
Determine current user has superuser role.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- whoAmI → OSString
-
Retrive name of user, who run this program.
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited