Sean Condon | 83fc39f | 2018-04-19 18:56:13 +0100 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright 2018-present Open Networking Foundation |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | import { DetectBrowserDirective } from '../../app/detectbrowser.directive'; |
| 17 | import { LogService } from '../../app/log.service'; |
| 18 | import { FnService } from '../../app/fw/util/fn.service'; |
| 19 | import { OnosService } from '../../app/onos.service'; |
| 20 | import { ActivatedRoute, Router} from '@angular/router'; |
| 21 | |
| 22 | class MockOnosService extends OnosService { |
| 23 | // Override things as necessary |
| 24 | } |
| 25 | |
| 26 | class MockFunctionService extends FnService { |
| 27 | // Override things as necessary |
| 28 | } |
| 29 | |
| 30 | /** |
| 31 | * ONOS GUI -- Detect Browser Directive - Unit Tests |
| 32 | */ |
| 33 | describe('DetectBrowserDirective', () => { |
| 34 | |
| 35 | let onos: MockOnosService; |
| 36 | let fs: MockFunctionService; |
| 37 | let log: LogService; |
| 38 | let ar: ActivatedRoute; |
| 39 | let directive: DetectBrowserDirective; |
| 40 | |
| 41 | beforeEach(() => { |
| 42 | log = new LogService(); |
| 43 | ar = new ActivatedRoute(); |
| 44 | onos = new MockOnosService(log); |
| 45 | fs = new MockFunctionService(ar, log); |
| 46 | directive = new DetectBrowserDirective(fs, log, onos); |
| 47 | }); |
| 48 | |
| 49 | afterEach(() => { |
| 50 | onos = null; |
| 51 | fs = null; |
| 52 | log = null; |
| 53 | ar = null; |
| 54 | directive = null; |
| 55 | }); |
| 56 | |
| 57 | it('should create an instance', () => { |
| 58 | expect(directive).toBeTruthy(); |
| 59 | }); |
| 60 | }); |