Move MockSdk into tests.

Also make _MockSdkLibrary implement noSuchMethod() to avoid breaking
because of unused methods in the future.

R=pquitslund@google.com, brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//2417463002 .
diff --git a/lib/src/analysis.dart b/lib/src/analysis.dart
index f04ba60..255f8b7 100644
--- a/lib/src/analysis.dart
+++ b/lib/src/analysis.dart
@@ -23,7 +23,6 @@
 import 'package:linter/src/linter.dart';
 import 'package:linter/src/project.dart';
 import 'package:linter/src/rules.dart';
-import 'package:linter/src/sdk.dart';
 import 'package:package_config/packages.dart' show Packages;
 import 'package:package_config/packages_file.dart' as pkgfile show parse;
 import 'package:package_config/src/packages_impl.dart' show MapPackages;
@@ -70,9 +69,8 @@
   int get numSourcesAnalyzed => _sourcesAnalyzed.length;
 
   List<UriResolver> get resolvers {
-    DartSdk sdk = options.useMockSdk
-        ? new MockSdk()
-        : new FolderBasedDartSdk(PhysicalResourceProvider.INSTANCE,
+    DartSdk sdk = options.mockSdk ??
+        new FolderBasedDartSdk(PhysicalResourceProvider.INSTANCE,
             PhysicalResourceProvider.INSTANCE.getFolder(sdkDir));
 
     List<UriResolver> resolvers = [new DartUriResolver(sdk)];
@@ -234,8 +232,8 @@
   /// Whether to use Dart's Strong Mode analyzer.
   bool strongMode = true;
 
-  /// Whether to use a mock SDK (to speed up testing).
-  bool useMockSdk = false;
+  /// The mock SDK (to speed up testing) or `null` to use the actual SDK.
+  DartSdk mockSdk;
 
   /// Whether to show lints for the transitive closure of imported and exported
   /// libraries.
diff --git a/pubspec.yaml b/pubspec.yaml
index 6c35092..2248643 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -1,5 +1,5 @@
 name: linter
-version: 0.1.27
+version: 0.1.28
 author: Dart Team <misc@dartlang.org>
 description: Style linter for Dart.
 homepage: https://github.com/dart-lang/linter
diff --git a/lib/src/sdk.dart b/test/mock_sdk.dart
similarity index 94%
rename from lib/src/sdk.dart
rename to test/mock_sdk.dart
index 2904637..398109f 100644
--- a/lib/src/sdk.dart
+++ b/test/mock_sdk.dart
@@ -346,27 +346,7 @@
       [this.parts = const <_MockSdkFile>[]]);
 
   @override
-  String get category => throw unimplemented;
-
-  @override
-  bool get isDart2JsLibrary => throw unimplemented;
-
-  @override
-  bool get isDocumented => throw unimplemented;
-
-  @override
-  bool get isImplementation => throw unimplemented;
-
-  @override
-  bool get isInternal => throw unimplemented;
-
-  @override
-  bool get isShared => throw unimplemented;
-
-  @override
-  bool get isVmLibrary => throw unimplemented;
-
-  UnimplementedError get unimplemented => new UnimplementedError();
+  noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation);
 }
 
 /// An [AnalysisContextImpl] that only contains sources for a Dart SDK.
diff --git a/test/rule_test.dart b/test/rule_test.dart
index 402d694..18fcb99 100644
--- a/test/rule_test.dart
+++ b/test/rule_test.dart
@@ -6,6 +6,7 @@
 
 import 'dart:io';
 
+import 'mock_sdk.dart';
 import 'package:analyzer/src/generated/engine.dart';
 import 'package:analyzer/src/generated/error.dart';
 import 'package:analyzer/src/generated/source.dart';
@@ -409,7 +410,7 @@
     }
 
     LinterOptions options = new LinterOptions([rule])
-      ..useMockSdk = true
+      ..mockSdk = new MockSdk()
       ..packageRootPath = '.';
 
     DartLinter driver = new DartLinter(options);