12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- using Microsoft.VisualStudio.TestTools.UnitTesting;
- using System;
- using Session2;
- namespace UnitTestSession2
- {
- [TestClass]
- public class UnitTest1
- {
- //Низкая сложность
- [TestMethod]
- public void TestAreEqualCheckMarkTrue()
- {
- Assert.AreEqual(REG_MARK_LIB.CheckMark("C065MK078"), true);
- }
- [TestMethod]
- public void TestAreEqualCheckMarkFalse()
- {
- Assert.AreEqual(REG_MARK_LIB.CheckMark("I714OP900"), false);
- }
- [TestMethod]
- public void TestAreEqualGetNextMarkAfter()
- {
- Assert.AreEqual(REG_MARK_LIB.GetNextMarkAfter("C065MK078"), "A66AA78");
- }
- [TestMethod]
- public void TestAreNotEqualGetNextMarkAfter()
- {
- Assert.AreNotEqual(REG_MARK_LIB.GetNextMarkAfter("C065MK078"), "A66AA078");
- }
- [TestMethod]
- public void TestIsTrueCheckMark()
- {
- Assert.IsTrue(REG_MARK_LIB.CheckMark("A000AA000"));
- }
- [TestMethod]
- public void TestIsFalseCheckMark()
- {
- Assert.IsFalse(REG_MARK_LIB.CheckMark("0000AA000"));
- }
- [TestMethod]
- public void TestIsInstanceOfTypeGetNextMarkAfterInRange()
- {
- Assert.IsInstanceOfType(REG_MARK_LIB.GetNextMarkAfterInRange("C148FY121", "C010HH00", "H091HY129"), typeof(string));
- }
- [TestMethod]
- public void TestAreNotEqualGetCombinationsCountInRange()
- {
- Assert.AreNotEqual(REG_MARK_LIB.GetCombinationsCountInRange("C065MK078", "C065MK097"), "19");
- }
- [TestMethod]
- public void TestIsNotInstanceOfTypeGetCombinationsCountInRange()
- {
- Assert.IsNotInstanceOfType(REG_MARK_LIB.GetCombinationsCountInRange("C065MK078", "C065MK097"), typeof(bool));
- }
- [TestMethod]
- public void TestReferenceEqualsCheckMark()
- {
- Assert.ReferenceEquals(REG_MARK_LIB.CheckMark("A00AA000"), REG_MARK_LIB.CheckMark("A111AA111"));
- }
- //Высокая сложность
- [TestMethod]
- public void TestThrowsExceptionGetNextMarkAfter1()
- {
- Assert.ThrowsException<System.Exception>(() => REG_MARK_LIB.GetNextMarkAfter("dd17dd"));
- }
- [TestMethod]
- public void TestThrowsExceptionGetNextMarkAfter2()
- {
- Assert.ThrowsException<System.Exception>(() => REG_MARK_LIB.GetNextMarkAfter("йцу12"));
- }
- [TestMethod]
- public void TestThrowsExceptionGetNextMarkAfterInRange()
- {
- Assert.ThrowsException<System.Exception>(() => REG_MARK_LIB.GetNextMarkAfterInRange("PL43L32", "G143", "tr321hy092"));
- }
- [TestMethod]
- public void TestThrowsExceptionGetCombinationsCountInRange1()
- {
- Assert.ThrowsException<System.Exception>(() => REG_MARK_LIB.GetCombinationsCountInRange("0F3S3", "54gww21"));
- }
- [TestMethod]
- public void TestThrowsExceptionGetCombinationsCountInRange2()
- {
- Assert.ThrowsException<System.Exception>(() => REG_MARK_LIB.GetCombinationsCountInRange("G-1Kf", ""));
- }
- }
- }
|