summaryrefslogtreecommitdiffstats
path: root/src/app
diff options
context:
space:
mode:
authorArundathi Patil <arundpil@in.ibm.com>2018-08-07 15:19:32 +0530
committerTakamune Cho <tc012c@att.com>2018-08-07 15:16:05 +0000
commitbb3646a3933dff23d0d8a967778fa72ad56b1343 (patch)
treecb7b4145f7ed38cedce5b8f42c927b32d1490e70 /src/app
parent7509cd4976b4a6cda9076f14a75c68b29b0d8921 (diff)
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 <arundpil@in.ibm.com>
Diffstat (limited to 'src/app')
-rw-r--r--src/app/shared/services/utilityService/utility.service.spec.ts10
1 files changed, 10 insertions, 0 deletions
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);
+ }));
});