Skip to content

Commit

Permalink
xsunit for sapmentors#25
Browse files Browse the repository at this point in the history
  • Loading branch information
gregorwolf authored and open-ui5 committed Oct 14, 2016
1 parent 10163f4 commit 1279db8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion odatareceptionist/procedures/PrintQueue.xsunit.xsjslib
Original file line number Diff line number Diff line change
@@ -1 +1 @@
describe("Print Queue Tests", function() { var cut = $.import("com.sap.sapmentors.sitreg.odatareceptionist.procedures", "PrintQueue"); var participant; var ParticipantID; var EventID; beforeOnce(function() { var select = 'SELECT TOP 1 "ID", "Participant"."EventID" ' + 'FROM "com.sap.sapmentors.sitreg.data::SITreg.Participant" AS "Participant" ' + 'LEFT JOIN "com.sap.sapmentors.sitreg.data::SITreg.Device" AS "Device" ' + 'ON "Device"."EventID" = "Participant"."EventID" '; var pStmt = jasmine.dbConnection.prepareStatement(select); var rs = pStmt.executeQuery(); if (rs.next()) { ParticipantID = rs.getInteger(1); EventID = rs.getInteger(1); } pStmt.close(); }); it('should read participant details', function() { participant = cut.readParticipant(ParticipantID); expect(participant.ParticipantID).toBe(ParticipantID); }); it('should fill print queue', function() { participant.PrintStatus = 'P'; var status = cut.addParticipantToPrintQueue(participant); expect(status.error).toBe(undefined); expect(status.count).toBe(0); }); it('check if participant was inserted', function() { var count = cut.isParticipantInPrintQueue(ParticipantID); expect(count).toBe(1); }); afterOnce(function() { var select = 'DELETE FROM "com.sap.sapmentors.sitreg.data::SITreg.PrintQueue" ' + 'WHERE "ParticipantID" = ?'; var pStmt = jasmine.dbConnection.prepareStatement(select); pStmt.setInteger(1, participant.ParticipantID); pStmt.execute(); jasmine.dbConnection.commit(); pStmt.close(); });});
describe("Print Queue Tests", function() { var cut = $.import("com.sap.sapmentors.sitreg.odatareceptionist.procedures", "PrintQueue"); var participant; var ParticipantID; var EventID; beforeOnce(function() { var select = 'SELECT TOP 1 "ID", "Participant"."EventID" ' + 'FROM "com.sap.sapmentors.sitreg.data::SITreg.Participant" AS "Participant" ' + 'LEFT JOIN "com.sap.sapmentors.sitreg.data::SITreg.Device" AS "Device" ' + 'ON "Device"."EventID" = "Participant"."EventID" '; var pStmt = jasmine.dbConnection.prepareStatement(select); var rs = pStmt.executeQuery(); if (rs.next()) { ParticipantID = rs.getInteger(1); EventID = rs.getInteger(1); } pStmt.close(); }); it('should read participant details', function() { participant = cut.readParticipant(ParticipantID); expect(participant.ParticipantID).toBe(ParticipantID); }); it('should fill print queue', function() { participant.PrintStatus = 'P'; var status = cut.addParticipantToPrintQueue(participant); expect(status.error).toBe(undefined); expect(status.count).toBe(0); }); it('check if participant was inserted', function() { var count = cut.isParticipantInPrintQueue(ParticipantID); expect(count).toBe(1); }); afterOnce(function() { var select = 'DELETE FROM "com.sap.sapmentors.sitreg.data::SITreg.PrintQueue" ' + 'WHERE "ParticipantID" = ?'; var pStmt = jasmine.dbConnection.prepareStatement(select); pStmt.setInteger(1, participant.ParticipantID); pStmt.execute(); jasmine.dbConnection.commit(); pStmt.close(); });});
Expand Down

0 comments on commit 1279db8

Please sign in to comment.