UnitTest.cs 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. using Microsoft.VisualStudio.TestTools.UnitTesting;
  2. using System;
  3. using project;
  4. namespace ModulTest
  5. {
  6. [TestClass]
  7. public class UnitTest
  8. {
  9. [TestMethod]
  10. public void autorization_valid()
  11. {
  12. Testovik obj = new Testovik();
  13. string login = "123";
  14. string password = "123";
  15. string res = "Вы успешно вошли";
  16. string result = obj.autoRization(login, password);
  17. Assert.AreEqual(res, result);
  18. }
  19. [TestMethod]
  20. public void autorization_not_login()
  21. {
  22. Testovik obj = new Testovik();
  23. string login = null;
  24. string password = "123";
  25. string res = "Введите логин";
  26. string result = obj.autoRization(login, password);
  27. Assert.AreEqual(res, result);
  28. }
  29. [TestMethod]
  30. public void autorization_not_password()
  31. {
  32. Testovik obj = new Testovik();
  33. string login = "123";
  34. string password = null;
  35. string res = "Введите пароль";
  36. string result = obj.autoRization(login, password);
  37. Assert.AreEqual(res, result);
  38. }
  39. [TestMethod]
  40. public void autorization_no_valid()
  41. {
  42. Testovik obj = new Testovik();
  43. string login = "1234234123123";
  44. string password = "5673342134";
  45. string res = "Неверный логин и/или пароль";
  46. string result = obj.autoRization(login, password);
  47. Assert.AreEqual(res, result);
  48. }
  49. }
  50. }