UnitTest1.cs 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. using testirovanie;
  2. namespace TestProject1
  3. {
  4. [TestClass]
  5. public class UnitTest1
  6. {
  7. [TestMethod]
  8. public void CheckMark_IsTrue()
  9. {
  10. Assert.IsTrue(REG_MARK_LIB.CheckMark("À999ÀÀ52"));
  11. }
  12. [TestMethod]
  13. public void CheckMark_IsFalse()
  14. {
  15. Assert.IsFalse(REG_MARK_LIB.CheckMark("À888ÁÀ52"));
  16. }
  17. [TestMethod]
  18. public void CheckMark_AreEquals_True()
  19. {
  20. Assert.AreEqual(REG_MARK_LIB.CheckMark("Â042ÅÊ77"), true);
  21. }
  22. [TestMethod]
  23. public void CheckMark_AreEquals_False()
  24. {
  25. Assert.AreEqual(REG_MARK_LIB.CheckMark("Á481ÊÅ77"), false);
  26. }
  27. [TestMethod]
  28. public void GetNextMarkAfter_NextMark_TypeIsString()
  29. {
  30. Assert.IsInstanceOfType(REG_MARK_LIB.GetNextMarkAfter("À421ÅÓ52"), typeof(string));
  31. }
  32. [TestMethod]
  33. public void GetNextMarkAfter_NextMark_IsNotNull()
  34. {
  35. Assert.IsNotNull(REG_MARK_LIB.GetNextMarkAfter("À941ÅÅ52"));
  36. }
  37. [TestMethod]
  38. public void GetCombinationsCountInRange_Count_TypeIsInt()
  39. {
  40. Assert.IsInstanceOfType(REG_MARK_LIB.GetCombinationsCountInRange("À001ÀÀ52", "À002ÀÁ52"), typeof(int));
  41. }
  42. [TestMethod]
  43. public void GetCombinationsCountInRange_Count_AreEquals()
  44. {
  45. Assert.AreEqual(REG_MARK_LIB.GetCombinationsCountInRange("À001ÀÀ52", "À001ÀÁ"), 1000);
  46. }
  47. [TestMethod]
  48. public void GetNextMarkAfter_NextMark_AreEquals()
  49. {
  50. Assert.AreEqual(REG_MARK_LIB.GetNextMarkAfter("À001ÓÓ52"), "À002ÓÓ52");
  51. }
  52. [TestMethod]
  53. public void GetNextMarkAfter_NextMark_AreNotEqual()
  54. {
  55. Assert.AreNotEqual(REG_MARK_LIB.GetNextMarkAfter("À001ÓÓ52"), "À003ÓÓ52");
  56. }
  57. [TestMethod]
  58. public void HardMethod_GetNextMarkAfterInRange_NextMark_AreEqual()
  59. {
  60. Assert.AreEqual(REG_MARK_LIB.GetNextMarkAfterInRange("À003ÀÀ52", "À001ÀÀ52", "À005ÀÀ52"), "À004ÀÀ52");
  61. }
  62. }
  63. }