From: Arundathi Patil Date: Tue, 7 Aug 2018 09:49:32 +0000 (+0530) Subject: Utility service : added test case X-Git-Tag: 1.4.0~53 X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F95%2F59395%2F2;p=appc%2Fcdt.git Utility service : added test case Wrote test cases to cover checkNotNull function in utility service. Issue-ID: APPC-1064 Change-Id: Icb9dc8872634e8772349e1bbbb7f15f39d292aec Signed-off-by: Arundathi Patil --- diff --git a/src/app/shared/services/utilityService/utility.service.spec.ts b/src/app/shared/services/utilityService/utility.service.spec.ts index 4054a89..80bedeb 100644 --- a/src/app/shared/services/utilityService/utility.service.spec.ts +++ b/src/app/shared/services/utilityService/utility.service.spec.ts @@ -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); + })); });