patient.Test.js 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /**
  2. * 患者模型测试。
  3. *
  4. * author: Sand
  5. * since: 2016/11/18
  6. */
  7. "use strict";
  8. var assert = require('assert');
  9. var Patient = require('../../../../src/server/models/user/patient');
  10. describe('Patient class', function () {
  11. describe('Method: sendMessage', function () {
  12. describe('when send to patient', function () {
  13. it('should return success', function (done) {
  14. var patient = new Patient();
  15. patient.sendMessage({
  16. startId: 102,
  17. count: 1,
  18. records: [
  19. {
  20. id: 102,
  21. from: 'cd914c70-5b06-11e6-8344-fa163e8aee56',
  22. to: 'shiliuP20160926001',
  23. contentType: '1',
  24. content: '您的血小板值偏低,平时有贫血症状吗?',
  25. timestamp: new Date()
  26. },
  27. {
  28. id: 100,
  29. from: 'cd914c70-5b06-11e6-8344-fa163e8aee56',
  30. to: 'shiliuP20160926001',
  31. contentType: '1',
  32. content: 'Hello',
  33. timestamp: new Date()
  34. }
  35. ]});
  36. done();
  37. });
  38. });
  39. });
  40. });