TestRasrad.cs 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. using RasradDll;
  2. namespace TestRasradDll
  3. {
  4. [TestClass]
  5. public class TestRasrad
  6. {
  7. /// <summary>
  8. /// Ïðîâåðêà ôóíêöèè GetReversRasrad
  9. /// </summary>
  10. [TestMethod]
  11. public void GetReversRasrad_nubmer123456789ToList_returnList123456789()
  12. {
  13. int n = 123456789;
  14. double expected = 987654321;
  15. Rasrad rasrad = new Rasrad();
  16. double result = rasrad.GetReversRasrad(n);
  17. Assert.AreEqual(expected, result);
  18. }
  19. /// <summary>
  20. /// Ïðîâåðêà ôóíêöèè GetReversRasrad
  21. /// </summary>
  22. [TestMethod]
  23. public void GetReversRasrad_nubmer567382ToList_returnList283765()
  24. {
  25. int n = 567382;
  26. double expected = 283765;
  27. Rasrad rasrad = new Rasrad();
  28. double result = rasrad.GetReversRasrad(n);
  29. Assert.AreEqual(expected, result);
  30. }
  31. /// <summary>
  32. /// Ïðîâåðêà ôóíêöèè GetList
  33. /// </summary>
  34. [TestMethod]
  35. public void GetList_nubmer1234ToList_returnList1234()
  36. {
  37. int n = 1234;
  38. List<int> expected = new List<int> { 4, 3, 2, 1 };
  39. Rasrad rasrad = new Rasrad();
  40. List<int> result = rasrad.GetList(n);
  41. CollectionAssert.AreEqual(expected, result);
  42. }
  43. /// <summary>
  44. /// Ïðîâåðêà ôóíêöèè GetList
  45. /// </summary>
  46. [TestMethod]
  47. public void GetList_nubmer1111ToList_returnList1111()
  48. {
  49. int n = 1111;
  50. List<int> expected = new List<int> { 1, 1, 1, 1 };
  51. Rasrad rasrad = new Rasrad();
  52. List<int> result = rasrad.GetList(n);
  53. CollectionAssert.AreEqual(expected, result);
  54. }
  55. }
  56. }