-
Notifications
You must be signed in to change notification settings - Fork 199
Release 2.2.4 #459
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
Merged
Merged
Release 2.2.4 #459
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
e9cc958
Fix capitalization style for UUID and constant names (#437)
7fefee1
Add unit tests for Service (#439)
bartoszwilk 9f69699
Descriptor unit tests (#441)
bartoszwilk 8ab4908
Merge branch 'master' into develop
mikolak 79ebf44
[iOS] Fixed casting of Bool arguments received from dart (#451)
TomoLV 9ca6b54
Remove root level `Flutter User Facing API.dart` (#455)
dustin-graham fa3e63b
Release 2.2.4
mikolak File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
group 'com.polidea.flutter_ble_lib' | ||
version '2.2.3' | ||
version '2.2.4' | ||
|
||
buildscript { | ||
repositories { | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
name: flutter_ble_lib | ||
description: FlutterBle Library is a flutter library that supports BLE operations. It uses MultiPlatformBleAdapter as a native backend.. | ||
version: 2.2.3 | ||
version: 2.2.4 | ||
author: "Polidea <[email protected]>" | ||
homepage: https://github.com/Polidea/FlutterBleLib | ||
|
||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,118 @@ | ||
import 'dart:async'; | ||
import 'dart:typed_data'; | ||
|
||
import 'package:flutter_ble_lib/flutter_ble_lib.dart'; | ||
import 'package:flutter_ble_lib/src/_managers_for_classes.dart'; | ||
import 'package:mockito/mockito.dart'; | ||
import 'package:test/test.dart'; | ||
|
||
import 'mock/mocks.dart'; | ||
import 'test_util/descriptor_generator.dart'; | ||
|
||
void main() { | ||
ManagerForDescriptor managerForDescriptor = ManagerForDescriptorMock(); | ||
DescriptorGenerator descriptorGenerator = | ||
DescriptorGenerator(managerForDescriptor); | ||
|
||
DescriptorWithValue createDescriptor(int seed) => | ||
descriptorGenerator.create(seed, CharacteristicMock()); | ||
|
||
Descriptor descriptor = createDescriptor(123); | ||
|
||
tearDown(() { | ||
clearInteractions(managerForDescriptor); | ||
}); | ||
|
||
test("read returns expected value", () async { | ||
//given | ||
when(managerForDescriptor.readDescriptorForIdentifier(descriptor, "456")) | ||
.thenAnswer((_) => Future.value(Uint8List.fromList([1, 2, 3, 4]))); | ||
|
||
//when | ||
var value = await descriptor.read(transactionId: "456"); | ||
|
||
//then | ||
expect(value, equals(Uint8List.fromList([1, 2, 3, 4]))); | ||
}); | ||
|
||
test( | ||
"read invokes manager with expected params when transactionId is specified", | ||
() { | ||
//when | ||
descriptor.read(transactionId: "456"); | ||
|
||
//then | ||
verify( | ||
managerForDescriptor.readDescriptorForIdentifier(descriptor, "456"), | ||
); | ||
}); | ||
|
||
test( | ||
"read invokes manager with expected params when transactionId is not specified", | ||
() { | ||
//when | ||
descriptor.read(); | ||
|
||
//then | ||
verify( | ||
managerForDescriptor.readDescriptorForIdentifier( | ||
descriptor, argThat(isNotNull)), | ||
); | ||
}); | ||
|
||
test( | ||
"read invokes manager with unique transactionId when transactionId is not specified", | ||
() { | ||
//when | ||
descriptor.read(); | ||
descriptor.read(); | ||
|
||
//then | ||
var transactionIds = verify( | ||
managerForDescriptor.readDescriptorForIdentifier( | ||
descriptor, captureThat(isNotNull)), | ||
).captured; | ||
expect(transactionIds[0], isNot(equals(transactionIds[1]))); | ||
}); | ||
|
||
test( | ||
"write invokes manager with expected params when transactionId is specified", | ||
() { | ||
//when | ||
descriptor.write(Uint8List.fromList([1, 2, 3, 4]), transactionId: "456"); | ||
|
||
//then | ||
verify( | ||
managerForDescriptor.writeDescriptorForIdentifier( | ||
descriptor, Uint8List.fromList([1, 2, 3, 4]), "456"), | ||
); | ||
}); | ||
|
||
test( | ||
"write invokes manager with expected params when transactionId is not specified", | ||
() { | ||
//when | ||
descriptor.write(Uint8List.fromList([1, 2, 3, 4])); | ||
|
||
//then | ||
verify( | ||
managerForDescriptor.writeDescriptorForIdentifier( | ||
descriptor, Uint8List.fromList([1, 2, 3, 4]), argThat(isNotNull)), | ||
); | ||
}); | ||
|
||
test( | ||
"write invokes manager with unique transactionId when transactionId is not specified", | ||
() { | ||
//when | ||
descriptor.write(Uint8List.fromList([1, 2, 3, 4])); | ||
descriptor.write(Uint8List.fromList([1, 2, 3, 4])); | ||
|
||
//then | ||
var transactionIds = verify( | ||
managerForDescriptor.writeDescriptorForIdentifier(descriptor, | ||
Uint8List.fromList([1, 2, 3, 4]), captureThat(isNotNull))) | ||
.captured; | ||
expect(transactionIds[0], isNot(equals(transactionIds[1]))); | ||
}); | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
<3