Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(698)

Unified Diff: pkg/shelf/test/response_test.dart

Issue 226263007: issue 17992 Added extra params to message (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: review updates. Renamed extraParams to context. Updated comment Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/shelf/test/request_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/shelf/test/response_test.dart
diff --git a/pkg/shelf/test/response_test.dart b/pkg/shelf/test/response_test.dart
index 3006d703adc41a1cf87c7972054c5d09a0db4092..af0e4562bffb498db30bb52aeb6f4c0b40228d34 100644
--- a/pkg/shelf/test/response_test.dart
+++ b/pkg/shelf/test/response_test.dart
@@ -231,4 +231,56 @@ void main() {
}).contentLength, equals(42));
});
});
+
+
+ group("context", () {
+ test("are correctly populated in ok", () {
+ expect(new Response.ok("okay!", headers: {}, context: {
+ 'my-param' : 42
+ }).context['my-param'], equals(42));
+ });
+
+ test("are correctly populated in forbidden", () {
+ expect(new Response.forbidden("okay!", headers: {}, context: {
+ 'my-param' : 42
+ }).context['my-param'], equals(42));
+ });
+
+ test("are correctly populated in found", () {
+ expect(new Response.found("okay!", headers: {}, context: {
+ 'my-param' : 42
+ }).context['my-param'], equals(42));
+ });
+
+ test("are correctly populated in internalServerError", () {
+ expect(new Response.internalServerError(headers: {}, context: {
+ 'my-param' : 42
+ }).context['my-param'], equals(42));
+ });
+
+ test("are correctly populated in movedPermanently", () {
+ expect(new Response.movedPermanently("okay!", headers: {}, context: {
+ 'my-param' : 42
+ }).context['my-param'], equals(42));
+ });
+
+ test("are correctly populated in notFound", () {
+ expect(new Response.notFound("okay!", headers: {}, context: {
+ 'my-param' : 42
+ }).context['my-param'], equals(42));
+ });
+
+ test("are correctly populated in notModified", () {
+ expect(new Response.notModified(headers: {}, context: {
+ 'my-param' : 42
+ }).context['my-param'], equals(42));
+ });
+
+ test("are correctly populated in seeOther", () {
+ expect(new Response.seeOther("other", headers: {}, context: {
+ 'my-param' : 42
+ }).context['my-param'], equals(42));
+ });
+});
+
}
« no previous file with comments | « pkg/shelf/test/request_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698