You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

72 lines
3.1 KiB

  1. const chai = require('chai');
  2. const calc = require('../calc.js');
  3. const {expect} = chai;
  4. describe('calc', () => {
  5. it('encrypt and decrypt', () => {
  6. // metalmine
  7. expect(60).to.be.equal(calc.metalmineCost(1).Metal);
  8. expect(15).to.be.equal(calc.metalmineCost(1).Crystal);
  9. expect(0).to.be.equal(calc.metalmineCost(1).Deuterium);
  10. expect(0).to.be.equal(calc.metalmineCost(1).Energy);
  11. expect(90).to.be.equal(calc.metalmineCost(2).Metal);
  12. expect(22).to.be.equal(calc.metalmineCost(2).Crystal);
  13. expect(0).to.be.equal(calc.metalmineCost(2).Deuterium);
  14. expect(0).to.be.equal(calc.metalmineCost(2).Energy);
  15. expect(17515).to.be.equal(calc.metalmineCost(15).Metal);
  16. expect(4378).to.be.equal(calc.metalmineCost(15).Crystal);
  17. expect(0).to.be.equal(calc.metalmineCost(15).Deuterium);
  18. expect(0).to.be.equal(calc.metalmineCost(15).Energy);
  19. // crystalmine
  20. expect(48).to.be.equal(calc.crystalmineCost(1).Metal);
  21. expect(24).to.be.equal(calc.crystalmineCost(1).Crystal);
  22. expect(0).to.be.equal(calc.crystalmineCost(1).Deuterium);
  23. expect(0).to.be.equal(calc.crystalmineCost(1).Energy);
  24. expect(76).to.be.equal(calc.crystalmineCost(2).Metal);
  25. expect(38).to.be.equal(calc.crystalmineCost(2).Crystal);
  26. expect(0).to.be.equal(calc.crystalmineCost(2).Deuterium);
  27. expect(0).to.be.equal(calc.crystalmineCost(2).Energy);
  28. expect(34587).to.be.equal(calc.crystalmineCost(15).Metal);
  29. expect(17293).to.be.equal(calc.crystalmineCost(15).Crystal);
  30. expect(0).to.be.equal(calc.crystalmineCost(15).Deuterium);
  31. expect(0).to.be.equal(calc.crystalmineCost(15).Energy);
  32. // deuteriummine
  33. expect(225).to.be.equal(calc.deuteriummineCost(1).Metal);
  34. expect(75).to.be.equal(calc.deuteriummineCost(1).Crystal);
  35. expect(0).to.be.equal(calc.deuteriummineCost(1).Deuterium);
  36. expect(0).to.be.equal(calc.deuteriummineCost(1).Energy);
  37. expect(337).to.be.equal(calc.deuteriummineCost(2).Metal);
  38. expect(112).to.be.equal(calc.deuteriummineCost(2).Crystal);
  39. expect(0).to.be.equal(calc.deuteriummineCost(2).Deuterium);
  40. expect(0).to.be.equal(calc.deuteriummineCost(2).Energy);
  41. expect(65684).to.be.equal(calc.deuteriummineCost(15).Metal);
  42. expect(21894).to.be.equal(calc.deuteriummineCost(15).Crystal);
  43. expect(0).to.be.equal(calc.deuteriummineCost(15).Deuterium);
  44. expect(0).to.be.equal(calc.deuteriummineCost(15).Energy);
  45. // energymine
  46. expect(75).to.be.equal(calc.energymineCost(1).Metal);
  47. expect(30).to.be.equal(calc.energymineCost(1).Crystal);
  48. expect(0).to.be.equal(calc.energymineCost(1).Deuterium);
  49. expect(0).to.be.equal(calc.energymineCost(1).Energy);
  50. expect(112).to.be.equal(calc.energymineCost(2).Metal);
  51. expect(45).to.be.equal(calc.energymineCost(2).Crystal);
  52. expect(0).to.be.equal(calc.energymineCost(2).Deuterium);
  53. expect(0).to.be.equal(calc.energymineCost(2).Energy);
  54. expect(21894).to.be.equal(calc.energymineCost(15).Metal);
  55. expect(8757).to.be.equal(calc.energymineCost(15).Crystal);
  56. expect(0).to.be.equal(calc.energymineCost(15).Deuterium);
  57. expect(0).to.be.equal(calc.energymineCost(15).Energy);
  58. });
  59. });