mirror of
https://github.com/SkinnyMind/libgit2dart.git
synced 2025-05-04 20:29:08 -04:00
feat(signature): add bindings and api for default signature
This commit is contained in:
parent
72107dea60
commit
3b883c49e3
5 changed files with 55 additions and 9 deletions
|
@ -26,18 +26,16 @@ void main() {
|
|||
});
|
||||
|
||||
test('successfully creates without provided time and offset', () {
|
||||
final defaultSignature =
|
||||
Signature.create(name: 'Name', email: 'email@example.com');
|
||||
expect(defaultSignature, isA<Signature>());
|
||||
expect(defaultSignature.name, 'Name');
|
||||
expect(defaultSignature.email, 'email@example.com');
|
||||
final sig = Signature.create(name: 'Name', email: 'email@example.com');
|
||||
expect(sig, isA<Signature>());
|
||||
expect(sig.name, 'Name');
|
||||
expect(sig.email, 'email@example.com');
|
||||
expect(
|
||||
defaultSignature.time -
|
||||
(DateTime.now().millisecondsSinceEpoch / 1000).truncate(),
|
||||
sig.time - (DateTime.now().millisecondsSinceEpoch / 1000).truncate(),
|
||||
lessThan(5),
|
||||
);
|
||||
expect(defaultSignature.offset, 180);
|
||||
defaultSignature.free();
|
||||
expect(sig.offset, 180);
|
||||
sig.free();
|
||||
});
|
||||
|
||||
test('returns correct values', () {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue