Chromium Code Reviews| Index: pkg/analysis_server/test/resource_test.dart |
| diff --git a/pkg/analysis_server/test/resource_test.dart b/pkg/analysis_server/test/resource_test.dart |
| index 4818dc6e3289cfc0cdd2c522f9aae79f39aeb18a..52899f4850c30dbc3a05565bc9b104c2b2806e58 100644 |
| --- a/pkg/analysis_server/test/resource_test.dart |
| +++ b/pkg/analysis_server/test/resource_test.dart |
| @@ -22,6 +22,52 @@ main() { |
| provider = new MemoryResourceProvider(); |
| }); |
| + test('MemoryResourceException', () { |
| + var exception = new MemoryResourceException('/my/path', 'my message'); |
| + expect(exception.path, '/my/path'); |
| + expect(exception.message, 'my message'); |
| + expect(exception.toString(), |
| + 'MemoryResourceException(path=/my/path; message=my message)'); |
| + }); |
| + |
| + group('newFolder', () { |
| + test('empty path', () { |
| + expect( |
| + () { |
| + provider.newFolder(''); |
| + }, |
| + throwsA(new isInstanceOf<ArgumentError>()) |
| + ); |
| + }); |
| + |
| + test('not absolute', () { |
| + expect( |
| + () { |
| + provider.newFolder('not/absolute'); |
| + }, |
| + throwsA(new isInstanceOf<ArgumentError>()) |
| + ); |
| + }); |
| + |
| + group('already exists', () { |
| + test('as folder', () { |
| + Folder folder = provider.newFolder('/my/folder'); |
| + Folder newFolder = provider.newFolder('/my/folder'); |
| + expect(newFolder, folder); |
| + }); |
| + |
| + test('as file', () { |
|
Brian Wilkerson
2014/05/27 19:32:26
Is it worth testing the creation of a file when a
|
| + File file = provider.newFile('/my/file', 'qwerty'); |
| + expect( |
| + () { |
| + provider.newFolder('/my/file'); |
| + }, |
| + throwsA(new isInstanceOf<ArgumentError>()) |
| + ); |
| + }); |
| + }); |
| + }); |
| + |
| group('File', () { |
| group('==', () { |
| test('false', () { |