UnitTest1.cs 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. using Microsoft.VisualStudio.TestTools.UnitTesting;
  2. using System;
  3. using Trif_Petun.form;
  4. namespace Test_prog
  5. {
  6. [TestClass]
  7. public class UnitTest1
  8. {
  9. SLRDbConnector.DbConnector db;
  10. [TestMethod]
  11. public void Proverka_na_password()
  12. {
  13. string pass = "hi54ew52";
  14. bool ex = true;
  15. Regist tm = new Regist();
  16. bool act = tm.format(pass);
  17. Assert.AreEqual(act, ex);
  18. }
  19. [TestMethod]
  20. public void Proverka_na_pystaty()
  21. {
  22. string log = "";
  23. string pass = "";
  24. bool ex = false;
  25. Avtomat tm = new Avtomat();
  26. bool act = tm.isFormVaid(log, pass);
  27. Assert.AreNotEqual(ex, act);
  28. }
  29. [TestMethod]
  30. public void Proverka_na_polzovatel()
  31. {
  32. string log = "kim";
  33. string pass = "15nt7rt95";
  34. bool ex = true;
  35. Regist tm = new Regist();
  36. bool act = tm.proverka(log, pass);
  37. Assert.AreEqual(ex, act);
  38. }
  39. [TestMethod]
  40. public void Proverka_na_zarplaty_false()
  41. {
  42. int one = 1000;
  43. int two = 500;
  44. bool ex = false;
  45. Rabota_rab tm = new Rabota_rab();
  46. bool act = tm.zp(one, two);
  47. Assert.AreEqual(ex, act);
  48. }
  49. [TestMethod]
  50. public void Proverka_na_zarplaty_true()
  51. {
  52. int one = 500;
  53. int two = 5000;
  54. bool ex = true;
  55. Rabota_rab tm = new Rabota_rab();
  56. bool act = tm.zp(one, two);
  57. Assert.AreEqual(ex, act);
  58. }
  59. }
  60. }