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

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

Issue 232073005: Addressed comments from review https://codereview.chromium.org/226263007 Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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 9ee47c5f93360f8a62b82680a7bdd597ff12be3e..e1e3ae6f1078ef5b4b770da717f7847e5f0b263f 100644
--- a/pkg/shelf/test/response_test.dart
+++ b/pkg/shelf/test/response_test.dart
@@ -157,4 +157,54 @@ void main() {
}).lastModified, equals(DateTime.parse("1994-11-06 08:49:37z")));
});
});
+
+ group("context", () {
+ test("are correctly populated in ok", () {
+ expect(new Response.ok("okay!", headers: {}, context: {
+ 'my-param' : 42
+ }).context['my-param'], equals(42));
+ });
+
+ test("is correctly populated in forbidden", () {
+ expect(new Response.forbidden("okay!", headers: {}, context: {
+ 'my-param' : 42
+ }).context['my-param'], equals(42));
+ });
+
+ test("is correctly populated in found", () {
+ expect(new Response.found("okay!", headers: {}, context: {
+ 'my-param' : 42
+ }).context['my-param'], equals(42));
+ });
+
+ test("is correctly populated in internalServerError", () {
+ expect(new Response.internalServerError(headers: {}, context: {
+ 'my-param' : 42
+ }).context['my-param'], equals(42));
+ });
+
+ test("is correctly populated in movedPermanently", () {
+ expect(new Response.movedPermanently("okay!", headers: {}, context: {
+ 'my-param' : 42
+ }).context['my-param'], equals(42));
+ });
+
+ test("is correctly populated in notFound", () {
+ expect(new Response.notFound("okay!", headers: {}, context: {
+ 'my-param' : 42
+ }).context['my-param'], equals(42));
+ });
+
+ test("is correctly populated in notModified", () {
+ expect(new Response.notModified(headers: {}, context: {
+ 'my-param' : 42
+ }).context['my-param'], equals(42));
+ });
+
+ test("is 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