UnitTest1.cs 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. using Microsoft.VisualStudio.TestTools.UnitTesting;
  2. using System;
  3. using Avokado;
  4. namespace UnitTests
  5. {
  6. [TestClass]
  7. public class UnitTest1
  8. {
  9. [TestMethod]
  10. public void TestMethod1()
  11. {
  12. authForm from = new authForm();
  13. string login = "";
  14. string password = "";
  15. string expected = "Поле ЛОГИН пустое!";
  16. string act = from.auth(login, password);
  17. Assert.AreEqual(expected, act);
  18. }
  19. [TestMethod]
  20. public void TestMethod2()
  21. {
  22. authForm from = new authForm();
  23. string login = "nagios";
  24. string password = "log";
  25. string expected = "Такого пользователя нет в базе!";
  26. string act = from.auth(login, password);
  27. Assert.AreEqual(expected, act);
  28. }
  29. [TestMethod]
  30. public void TestMethod3()
  31. {
  32. authForm from = new authForm();
  33. string login = "asd";
  34. string password = "asd";
  35. string expected = "Авторизация прошла успешно";
  36. string act = from.auth(login, password);
  37. Assert.AreEqual(expected, act);
  38. }
  39. }
  40. }