anchor.diff:  
     1. [Test a component with inputs and outputs](#component-with-inputs-output)
   
  -  1. [测试拥有导入（inputs）和导出（outputs）的组件](#component-with-inputs-output)  
  +  1. [测试拥有导入inputs和导出outputs的组件](#component-with-inputs-output)  
   
       - [_triggerEventHandler_](#trigger-event-handler)
   
  
positive.code: 
    The  Angular testing utilities include the `TestBed` class and several helper functions from `@angular/core/testing`.
  
    **Angular测试工具**包含了`TestBed`类和在`@angular/core/testing`中一些助手函数方法。
  
    The `TestBed` creates an Angular testing module &mdash; an `@NgModule` class &mdash;
    that you configure to produce the module environment for the class you want to test. 
  
negative.code:   Having compiled the components asynchronously with `compileComponents`, the rest of the setup
    proceeds _synchronously_ in a _second_ `beforeEach`, using the basic techniques described [earlier](#simple-component-test).
  
    异步`beforeEach`已经在[上面](#component-with-external-template)讨论过。
    在使用`compileComponents`异步编译完组件后，接下来的设置执行另一个**同步**的`beforeEach`，使用[之前](#simple-component-test)解释过的基本知识。
  
    Note how the setup code assigns a test hero (`expectedHero`) to the component's `hero` property, emulating
    the way the `DashboardComponent` would set it via the property binding in its repeater.
  
    注意代码是如何将一个测试英雄（`expectedHero`）赋值给组件的`hero`属性的，模拟了`DashbaordComponent`在它的迭代器中通过属性绑定的赋值方式。
  
    The first test follows:
  
    紧接着第一个测试：
  
  +makeExample('testing/ts/app/dashboard/dashboard-hero.component.spec.ts', 'name-test', 'app/dashboard/dashboard-hero.component.spec.ts (name test)')(format='.')
  :marked
    It verifies that the hero name is propagated through to template with a binding.
    There's a twist. The template passes the hero name through the Angular `UpperCasePipe` so the
    test must match the element value with the uppercased name:
  
    它验证了英雄名字通过绑定被传递到模板了。这里有个意外曲折。模板将英雄名字传给Angular的`UpperCasePipe`，
    所以测试必须使用大写名字来匹配元素的值：
  +makeExample('testing/ts/app/dashboard/dashboard-hero.component.html')(format='.')
  :marked
  .alert.is-helpful
  