blob: d925ecf7e012ce09ec4186cf32ed86d25c56dee3 [file] [log] [blame]
Sean Condon83fc39f2018-04-19 18:56:13 +01001/*
Sean Condonf4f54a12018-10-10 23:25:46 +01002 * Copyright 2018-present Open Networking Foundation
Sean Condon83fc39f2018-04-19 18:56:13 +01003 *
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 */
16import { TestBed, inject } from '@angular/core/testing';
17
Sean Condonf4f54a12018-10-10 23:25:46 +010018import { LogService } from '../log.service';
19import { ConsoleLoggerService } from '../consolelogger.service';
20import { PrefsService } from '../util/prefs.service';
21import { FnService } from '../util/fn.service';
22import { WebSocketService } from '../remote/websocket.service';
Sean Condon49e15be2018-05-16 16:58:29 +010023
24class MockFnService {}
25
Sean Condonf4f54a12018-10-10 23:25:46 +010026class MockWebSocketService {
27 createWebSocket() {}
28 isConnected() { return false; }
29 unbindHandlers() {}
30 bindHandlers() {}
31}
Sean Condon83fc39f2018-04-19 18:56:13 +010032
33/**
Sean Condon49e15be2018-05-16 16:58:29 +010034 * ONOS GUI -- Util -- User Preference Service - Unit Tests
Sean Condon83fc39f2018-04-19 18:56:13 +010035 */
36describe('PrefsService', () => {
Sean Condon49e15be2018-05-16 16:58:29 +010037 let log: LogService;
Sean Condon83fc39f2018-04-19 18:56:13 +010038
Sean Condon49e15be2018-05-16 16:58:29 +010039 beforeEach(() => {
40 log = new ConsoleLoggerService();
41
42 TestBed.configureTestingModule({
43 providers: [PrefsService,
44 { provide: LogService, useValue: log },
45 { provide: FnService, useClass: MockFnService },
46 { provide: WebSocketService, useClass: MockWebSocketService },
47 ]
48 });
49 });
50
51 it('should be created', inject([PrefsService], (service: PrefsService) => {
52 expect(service).toBeTruthy();
53 }));
Sean Condon83fc39f2018-04-19 18:56:13 +010054});