UnitTest1.cs 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. using Microsoft.VisualStudio.TestTools.UnitTesting;
  2. using System;
  3. using PC_Build_Games_SQL;
  4. using System.Configuration;
  5. namespace UnitTestProject1
  6. {
  7. [TestClass]
  8. public class UnitTest1
  9. {
  10. [TestMethod]
  11. public void TestMethod1()
  12. {
  13. SQL sQL = new SQL();
  14. Assert.IsTrue(sQL.ConnectivityCheck());
  15. }
  16. [TestMethod]
  17. public void TestMethod2()
  18. {
  19. SQL sQL = new SQL();
  20. Assert.IsFalse(sQL.Login_verification("Valera","1234"));
  21. }
  22. [TestMethod]
  23. public void TestMethod3()
  24. {
  25. SQL sQL = new SQL();
  26. Assert.AreEqual(1, sQL.Registration("", "", "", "", ""));
  27. }
  28. [TestMethod]
  29. public void TestMethod4()
  30. {
  31. SQL sQL = new SQL();
  32. Assert.AreEqual("Ваша конфигурация подходит для рекомендованных требований", sQL.CompatibilityCheck("Белая", "The Witcher"));
  33. }
  34. [TestMethod]
  35. public void TestMethod5()
  36. {
  37. SQL sQL = new SQL();
  38. Assert.IsNull(sQL.User);
  39. }
  40. [TestMethod]
  41. public void TestMethod6()
  42. {
  43. SQL sQL = new SQL();
  44. sQL.Login_verification("7", "7");
  45. Assert.IsNotNull(sQL.User);
  46. }
  47. [TestMethod]
  48. public void TestMethod7()
  49. {
  50. SQL sQL = new SQL();
  51. Assert.AreEqual(sQL.Registration("valera", "valerovitch", "vava54234", "asfafs@asdf", "1234567"),5);
  52. }
  53. }
  54. }