UnitTest1.cs 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. using System;
  2. using Microsoft.VisualStudio.TestTools.UnitTesting;
  3. using CopyCenter;
  4. using System.Collections.Generic;
  5. using System.Linq;
  6. namespace CopyCenterTests
  7. {
  8. [TestClass]
  9. public class UnitTest1
  10. {
  11. gr672_liiEntities db;
  12. [TestMethod]
  13. public void TestMethod1()
  14. {
  15. db = new gr672_liiEntities();
  16. AuthorizationWindow Authorization = new AuthorizationWindow();
  17. Assert.IsFalse(Authorization.Auth("", ""));
  18. Assert.IsTrue(Authorization.Auth("PaNDa", "123"));
  19. }
  20. [TestMethod]
  21. public void RegistrTest()
  22. {
  23. RegistrationWindow Registration = new RegistrationWindow();
  24. Assert.IsFalse(Registration.Reg("", "", "", "", "", ""));
  25. //Assert.IsTrue(Registration.Reg("PaNDa", "123", "Иванов", "Иван", "Иванович", "454545"));
  26. }
  27. [TestMethod]
  28. public void CardInsertTest()
  29. {
  30. CardsWindow Card = new CardsWindow();
  31. Assert.IsFalse(Card.Insert("", "", ""));
  32. Assert.IsTrue(Card.Insert("5", "Скидочная", "23"));
  33. }
  34. [TestMethod]
  35. public void CardUpdateTest()
  36. {
  37. CardsWindow Card1 = new CardsWindow();
  38. Assert.IsFalse(Card1.Update("", "", ""));
  39. Assert.IsTrue(Card1.Update("5", "Скидочная", "23"));
  40. }
  41. [TestMethod]
  42. public void CardDeleteTest()
  43. {
  44. CardsWindow Cards = new CardsWindow();
  45. Assert.IsFalse(Cards.Delete("", "", ""));
  46. Assert.IsTrue(Cards.Delete("5", "Скидочная", "23"));
  47. }
  48. }
  49. }