--- /dev/null
+
+import { TestBed} from '@angular/core/testing';
+import { HttpClientTestingModule } from '@angular/common/http/testing';
+import { HttpClientModule } from '@angular/common/http';
+import { AdminService } from '../admin.service';
+import 'rxjs/add/observable/of';
+import { Observable } from 'rxjs/Observable';
+import 'rxjs/add/operator/catch';
+import 'rxjs/add/observable/throw';
+import { RoleFunctionsService } from './role-functions.service';
+
+describe('RoleFunctionsService', () => {
+
+ let component:RoleFunctionsService;
+ let service:AdminService;
+ var stubData={"data":{"active":"data2"}}
+
+ beforeEach(() =>{
+ TestBed.configureTestingModule({
+ imports:[HttpClientTestingModule],
+ providers: [HttpClientModule,RoleFunctionsService]
+ })
+ component = TestBed.get(RoleFunctionsService);
+ service = TestBed.get(AdminService);
+ });
+
+ it('should be created', () => {
+ const component: RoleFunctionsService = TestBed.get(RoleFunctionsService);
+ expect(component).toBeTruthy();
+ });
+
+ it('should test add method',()=>{
+ component.add("data");
+ })
+
+ it('should test update method',()=>{
+ let spy=spyOn(service,'saveRoleFunction').and.returnValue(Observable.of('your object'));
+ component.update("data");
+ expect(spy).toHaveBeenCalled();
+ })
+
+
+ it('should test delete method',()=>{
+ let spy=spyOn(service,'deleteRoleFunction').and.returnValue(Observable.of('your object'));
+ component.delete("data");
+ expect(spy).toHaveBeenCalled();
+ })
+
+
+});
\ No newline at end of file