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>
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);
+ }));
});