[geary/wip/composer-folks: 7/22] Add support for uint args in expected calls in MockObject
- From: Michael Gratton <mjog src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [geary/wip/composer-folks: 7/22] Add support for uint args in expected calls in MockObject
- Date: Sat, 15 Jun 2019 14:31:29 +0000 (UTC)
commit 91caff487bc39821768fd39e9b621ecee3383b3a
Author: Michael Gratton <mike vee net>
Date: Tue Jun 11 07:24:17 2019 +1000
Add support for uint args in expected calls in MockObject
test/mock-object.vala | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
---
diff --git a/test/mock-object.vala b/test/mock-object.vala
index 8c97a745..c684c8a7 100644
--- a/test/mock-object.vala
+++ b/test/mock-object.vala
@@ -44,6 +44,21 @@ private class IntArgument : Object, Argument {
}
+private class UintArgument : Object, Argument {
+
+ private uint value;
+
+ internal UintArgument(uint value) {
+ this.value = value;
+ }
+
+ public new void assert(Object object) throws Error {
+ assert_true(object is UintArgument, "Expected uint value");
+ assert_uint(this.value, ((UintArgument) object).value);
+ }
+
+}
+
/**
* Represents an expected method call on a mock object.
*
@@ -145,6 +160,10 @@ public interface MockObject {
return new IntArgument(value);
}
+ public static Object uint_arg(uint value) {
+ return new UintArgument(value);
+ }
+
protected abstract Gee.Queue<ExpectedCall> expected { get; set; }
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]