| 
									
										
										
										
											2015-11-05 14:07:57 -08:00
										 |  |  | import {ElementSchemaRegistry} from 'angular2/src/compiler/schema/element_schema_registry'; | 
					
						
							| 
									
										
										
										
											2015-11-06 17:34:07 -08:00
										 |  |  | import {isPresent} from 'angular2/src/facade/lang'; | 
					
						
							| 
									
										
										
										
											2015-09-14 15:59:09 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  | export class MockSchemaRegistry implements ElementSchemaRegistry { | 
					
						
							| 
									
										
										
										
											2015-10-02 16:47:54 -07:00
										 |  |  |   constructor(public existingProperties: {[key: string]: boolean}, | 
					
						
							|  |  |  |               public attrPropMapping: {[key: string]: string}) {} | 
					
						
							| 
									
										
										
										
											2015-09-14 15:59:09 -07:00
										 |  |  |   hasProperty(tagName: string, property: string): boolean { | 
					
						
							|  |  |  |     var result = this.existingProperties[property]; | 
					
						
							|  |  |  |     return isPresent(result) ? result : true; | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   getMappedPropName(attrName: string): string { | 
					
						
							|  |  |  |     var result = this.attrPropMapping[attrName]; | 
					
						
							|  |  |  |     return isPresent(result) ? result : attrName; | 
					
						
							|  |  |  |   } | 
					
						
							| 
									
										
										
										
											2015-10-02 09:30:36 -07:00
										 |  |  | } |