Fixed framework test cases

This commit is contained in:
thomashii@dukefirehawk.com 2021-05-29 09:14:16 +08:00
parent 16fc8c3436
commit 9c2f1dd0cb
7 changed files with 14 additions and 13 deletions

View file

@ -11,7 +11,7 @@
* Migrated angel_container to 3.0.0 (55/55 tests passed) * Migrated angel_container to 3.0.0 (55/55 tests passed)
* Added merge_map and migrated to 2.0.0 (6/6 tests passed) * Added merge_map and migrated to 2.0.0 (6/6 tests passed)
* Added mock_request and migrated to 2.0.0 (0/0 tests) * Added mock_request and migrated to 2.0.0 (0/0 tests)
* Migrated angel_framework to 4.0.0 (148/150 tests passed) * Migrated angel_framework to 4.0.0 (149/150 tests passed)
* Migrated angel_auth to 4.0.0 (23/30 tests passed) * Migrated angel_auth to 4.0.0 (23/30 tests passed)
* Migrated angel_configuration to 4.0.0 (6/8 testspassed) * Migrated angel_configuration to 4.0.0 (6/8 testspassed)
* Migrated angel_validate to 4.0.0 (6/7 tests passed) * Migrated angel_validate to 4.0.0 (6/7 tests passed)
@ -49,7 +49,7 @@
* Updated angel_route to 4.0.0 (35/35 tests passed) * Updated angel_route to 4.0.0 (35/35 tests passed)
* Updated angel_model to 2.0.0 (0/0 tests passed) * Updated angel_model to 2.0.0 (0/0 tests passed)
* Updated angel_container to 2.0.0 (55/55 tests passed) * Updated angel_container to 2.0.0 (55/55 tests passed)
* Updated angel_framework to 3.0.0 (151/151 tests passed) * Updated angel_framework to 3.0.0 (150/151 tests passed)
* Updated angel_auth to 3.0.0 (28/32 tests passed) * Updated angel_auth to 3.0.0 (28/32 tests passed)
* Updated angel_configuration to 3.0.0 (6/8 tests passed) * Updated angel_configuration to 3.0.0 (6/8 tests passed)
* Updated angel_validate to 3.0.0 (7/7 tests passed) * Updated angel_validate to 3.0.0 (7/7 tests passed)

View file

@ -1,3 +1,8 @@
# 4.0.3
* Fixed "Primitive after parsed param injection" test case
* Fixed "Cannot remove all unless explicitly set" test case
* Fixed "null" test case
# 4.0.2 # 4.0.2
* Updated README * Updated README

View file

@ -1,5 +1,5 @@
# angel3_framework # angel3_framework
[![version](https://img.shields.io/badge/pub-v4.0.2-brightgreen)](https://pub.dartlang.org/packages/angel3_framework) [![version](https://img.shields.io/badge/pub-v4.0.3-brightgreen)](https://pub.dartlang.org/packages/angel3_framework)
[![Null Safety](https://img.shields.io/badge/null-safety-brightgreen)](https://dart.dev/null-safety) [![Null Safety](https://img.shields.io/badge/null-safety-brightgreen)](https://dart.dev/null-safety)
[![Gitter](https://img.shields.io/gitter/room/angel_dart/discussion)](https://gitter.im/angel_dart/discussion) [![Gitter](https://img.shields.io/gitter/room/angel_dart/discussion)](https://gitter.im/angel_dart/discussion)

View file

@ -195,9 +195,9 @@ class Service<Id, Data> extends Routable {
/// ///
/// For example, `parseId<bool>` attempts to parse the value as a [bool]. /// For example, `parseId<bool>` attempts to parse the value as a [bool].
static T parseId<T>(id) { static T parseId<T>(id) {
if (id == 'null' || id == null) { if (id == null || id == 'null') {
//return 'null' as T; return 'null' as T;
throw ArgumentError("[Service] Null is not supported"); //throw ArgumentError("[Service] Null is not supported");
} else if (T == String) { } else if (T == String) {
return id.toString() as T; return id.toString() as T;
} else if (T == int) { } else if (T == int) {

View file

@ -1,5 +1,5 @@
name: angel3_framework name: angel3_framework
version: 4.0.2 version: 4.0.3
description: A high-powered HTTP server with dependency injection, routing and much more. description: A high-powered HTTP server with dependency injection, routing and much more.
homepage: https://github.com/dukefirehawk/angel/tree/angel3/packages/framework homepage: https://github.com/dukefirehawk/angel/tree/angel3/packages/framework
publish_to: none publish_to: none

View file

@ -3,11 +3,8 @@ import 'package:test/test.dart';
void main() { void main() {
test('null', () { test('null', () {
//expect(Service.parseId('null'), null); expect(Service.parseId('null'), 'null');
//expect(Service.parseId(null), null); expect(Service.parseId(null), 'null');
expect(() => Service.parseId('null'), throwsArgumentError);
expect(() => Service.parseId(null), throwsArgumentError);
}); });
test('String', () { test('String', () {

View file

@ -126,7 +126,6 @@ void main() {
}); });
test('cannot remove all unless explicitly set', () async { test('cannot remove all unless explicitly set', () async {
var a = "1234";
var response = await client.delete(Uri.parse('$url/todos/null')); var response = await client.delete(Uri.parse('$url/todos/null'));
expect(response.statusCode, 403); expect(response.statusCode, 403);
}); });