Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
adding another valid validator using brazil locale text
  • Loading branch information
eliasyishak committed Jan 27, 2023
commit 5a55ce9f082947e6026bc4f693d2af1a315ae6f7
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,15 @@ class FakeValidOperatingSystemUtils extends Fake
String get name => 'Microsoft Windows [Version 10.0.22621.963]';
}

/// A fake [_WindowsUtils] class for a valid version from Brazil
class FakeValidBrOperatingSystemUtils extends Fake
implements OperatingSystemUtils {
FakeValidBrOperatingSystemUtils();

@override
String get name => 'Microsoft Windows [versão 10.0.22621.1105]';
}

/// A fake [_WindowsUtils] class for a version that is not supported
class FakeInvalidOperatingSystemUtils extends Fake
implements OperatingSystemUtils {
Expand Down Expand Up @@ -58,6 +67,20 @@ void main() {
reason: 'The ValidationResult statusInfo messages should be the same');
});

testWithoutContext('Successfully running windows version check on windows 10 for BR',
() async {
final WindowsVersionValidator windowsVersionValidator =
WindowsVersionValidator(
operatingSystemUtils: FakeValidBrOperatingSystemUtils());

final ValidationResult result = await windowsVersionValidator.validate();

expect(result.type, validWindows10ValidationResult.type,
reason: 'The ValidationResult type should be the same (installed)');
expect(result.statusInfo, validWindows10ValidationResult.statusInfo,
reason: 'The ValidationResult statusInfo messages should be the same');
});

testWithoutContext('Identifying a windows version before 10', () async {
final WindowsVersionValidator windowsVersionValidator =
WindowsVersionValidator(
Expand Down