-
-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unit test for host scanner added #87
Conversation
.thenAnswer((_) => Stream.value(activeHost)); | ||
expect( | ||
mockHostScanner.getAllPingableDevices("10.0.0"), | ||
emits(ActiveHost(internetAddress: InternetAddress("10.0.0.1"))), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it pass in GitHub action even though it could be different IP?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fetching interface address and pinging own machine. Check now @guyluz11
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll add more cases in this PR only later.
emits(isA<ActiveHost>()), | ||
); | ||
}); | ||
|
||
test('Running getMaxHost tests', () { | ||
expect(HostScanner.getMaxHost("10.0.0.0"), HostScanner.classASubnets); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't it supposed to be 127.0.0.254 ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this function uses first octet of IPV4 to check for Subnet class. Success cases are added as of now. Will add more case where it cover cases like "10.0.0.0" can't be classB address.
Added for all methods of Host Scanner.
Completed mostly all cases for getMaxHost
At least one case of getAllPingableDevices and scanDevicesForSinglePort