Utility service : added test case 95/59395/2
authorArundathi Patil <arundpil@in.ibm.com>
Tue, 7 Aug 2018 09:49:32 +0000 (15:19 +0530)
committerTakamune Cho <tc012c@att.com>
Tue, 7 Aug 2018 15:16:05 +0000 (15:16 +0000)
Wrote test cases to cover checkNotNull function in utility service.

Issue-ID: APPC-1064
Change-Id: Icb9dc8872634e8772349e1bbbb7f15f39d292aec
Signed-off-by: Arundathi Patil <arundpil@in.ibm.com>
src/app/shared/services/utilityService/utility.service.spec.ts

index 4054a89..80bedeb 100644 (file)
@@ -81,4 +81,14 @@ describe('UtilityService', () => {
         let result = { output: {status: {code: '400'}}};
         service.processApiSubscribe(result, 'uploadArtifact', '');
     }));
+
+    it('should test checkNotNull function to return false on undefined object', inject([UtilityService], (service: UtilityService) => {
+        let obj;
+        expect(service.checkNotNull(obj)).toBe(false);
+    }));
+
+    it('should test checkNotNull function to return true on defined objects', inject([UtilityService], (service: UtilityService) => {
+        let obj = [{data : 'data'}];
+        expect(service.checkNotNull(obj)).toBe(true);
+    }));
 });