123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164 |
- namespace UnitTests
- {
- /// <summary>
- /// Êëàññ òåñòîâ íèçêîé ñëîæíîñòè
- /// </summary>
- public class LowDifficult
- {
- /// <summary>
- /// Òåñò ôóíêöèè CheckMark, ñ ïðàâèëüíûì íîìåðîì
- /// </summary>
- [Fact]
- public void TestCheckMarkWithCorrectData()
- {
- Assert.True(REG_MARK_LIB.REG_MARK_LIB.CheckMark("a999aa99"));
- }
- /// <summary>
- /// Òåñò ôóíêöèè CheckMark, ñ íåïðàâèëüíûì íîìåðîì
- /// </summary>
- [Fact]
- public void TestCheckMarkWithIncorrectData()
- {
- Assert.False(REG_MARK_LIB.REG_MARK_LIB.CheckMark("a999aa999"));
- }
- /// <summary>
- /// Òåñò ôóíêöèè GetNextMarkAfter, ïðîâåðêà íà èçìåíåíèå ÷èñëà â ñîñòàâå íîìåðà
- /// </summary>
- [Fact]
- public void TestGetNextMarkAfterWithCorrectDataOnSecondNumber()
- {
- Assert.Equal("T357OK52", REG_MARK_LIB.REG_MARK_LIB.GetNextMarkAfter("T356OK52"));
- }
- /// <summary>
- /// Òåñò ôóíêöèè GetNextMarkAfter, ïðîâåðêà íà èçìåíåíèå ïåðâîé áóêâû â ñîñòàâå íîìåðà
- /// </summary>
- [Fact]
- public void TestGetNextMarkAfterWithCorrectDataOnFirstLetter()
- {
- Assert.Equal("Y001OK52", REG_MARK_LIB.REG_MARK_LIB.GetNextMarkAfter("T999OK52"));
- }
- /// <summary>
- /// Òåñò ôóíêöèè GetNextMarkAfter, ïðîâåðêà íà èçìåíåíèå òðåòåé áóêâû â ñîñòàâå íîìåðà
- /// </summary>
- [Fact]
- public void TestGetNextMarkAfterWithCorrectDataOnThirdLetter()
- {
- Assert.Equal("A001OM52", REG_MARK_LIB.REG_MARK_LIB.GetNextMarkAfter("X999OK52"));
- }
- /// <summary>
- /// Òåñò ôóíêöèè GetNextMarkAfter, ïðîâåðêà íà èçìåíåíèå âòîðîé áóêâû â ñîñòàâå íîìåðà
- /// </summary>
- [Fact]
- public void TestGetNextMarkAfterWithCorrectDataOnSecondLetter()
- {
- Assert.Equal("A001PA52", REG_MARK_LIB.REG_MARK_LIB.GetNextMarkAfter("X999OX52"));
- }
- /// <summary>
- /// Òåñò ôóíêöèè GetNextMarkAfterInRange, ñ êîððåêòíûìè äàííûìè
- /// </summary>
- [Fact]
- public void TestGetNextMarkAfterInRangeWithCorrectData()
- {
- Assert.Equal("A001PA52", REG_MARK_LIB.REG_MARK_LIB.GetNextMarkAfterInRange("X999OX52", "A001AA52", "X999XX52"));
- }
- /// <summary>
- /// Òåñò ôóíêöèè GetNextMarkAfterInRange, ïðè èçíà÷àëüíîì íîìåðå íå âõîäÿùåì â äèàïàçîí (ìåíüøå)
- /// </summary>
- [Fact]
- public void TestGetNextMarkAfterInRangeWithIncorrectDataSmallerThanStart()
- {
- Assert.Equal("out of stock", REG_MARK_LIB.REG_MARK_LIB.GetNextMarkAfterInRange("A001AA52", "X999OX52", "X999XX52"));
- }
- /// <summary>
- /// Òåñò ôóíêöèè GetNextMarkAfterInRange, ïðè èçíà÷àëüíîì íîìåðå íå âõîäÿùåì â äèàïàçîí (áîëüøå)
- /// </summary>
- [Fact]
- public void TestGetNextMarkAfterInRangeWithIncorrectDataBiggerThanEnd()
- {
- Assert.Equal("out of stock", REG_MARK_LIB.REG_MARK_LIB.GetNextMarkAfterInRange("X999YX52", "A001AA52", "X999OX52"));
- }
- /// <summary>
- /// Òåñò ôóíêöèè GetNextMarkAfterInRange, ïðè íåêîððåêòíîì äèàïàçîíå
- /// </summary>
- [Fact]
- public void TestGetNextMarkAfterInRangeWithIncorrectDataIncorrectBounds()
- {
- Assert.Equal("out of stock", REG_MARK_LIB.REG_MARK_LIB.GetNextMarkAfterInRange("X999YX52", "X999OX52", "A001AA52"));
- }
- /// <summary>
- /// Òåñò ôóíêöèè GetCombinationsCountInRange, ñ îáû÷íûìè äàííûìè
- /// </summary>
- [Fact]
- public void TestGetCombinationsCountInRangeWithCorrectData()
- {
- Assert.Equal(2, REG_MARK_LIB.REG_MARK_LIB.GetCombinationsCountInRange("T356OK52", "T357OK52"));
- }
- /// <summary>
- /// Òåñò ôóíêöèè GetCombinationsCountInRange, ñ ïåðåâåðíóòûìè ãðàíèöàìè
- /// </summary>
- [Fact]
- public void TestGetCombinationsCountInRangeWithCorrectDataReverse()
- {
- Assert.Equal(2, REG_MARK_LIB.REG_MARK_LIB.GetCombinationsCountInRange("T357OK52", "T356OK52"));
- }
- /// <summary>
- /// Òåñò ôóíêöèè GetCombinationsCountInRange, ñ îäèíàêîâûìè ãðàíèöàìè
- /// </summary>
- [Fact]
- public void TestGetCombinationsCountInRangeWithCorrectDataEqualsBounds()
- {
- Assert.Equal(1, REG_MARK_LIB.REG_MARK_LIB.GetCombinationsCountInRange("T356OK52", "T356OK52"));
- }
- }
- /// <summary>
- /// Êëàññ òåñòîâ âûñîêîé ñëîæíîñòè
- /// </summary>
- public class HighDifficult
- {
- /// <summary>
- /// Òåñò ôóíêöèè CheckMark, ïðè ïåðåäà÷å null
- /// </summary>
- [Fact]
- public void TestCheckMarkOnNull()
- {
- Assert.Throws<ArgumentNullException>(() => REG_MARK_LIB.REG_MARK_LIB.CheckMark(null));
- }
- /// <summary>
- /// Òåñò ôóíêöèè GetNextMarkAfter, ïðè ïåðåäà÷å íå íîìåðà
- /// </summary>
- [Fact]
- public void TestGetNextMarkAfterOnNotMark()
- {
- Assert.Throws<ArgumentException>(() => REG_MARK_LIB.REG_MARK_LIB.GetNextMarkAfter("Hello world!"));
- }
- /// <summary>
- /// Òåñò ôóíêöèè GetNextMarkAfter, ïðè ïåðåäà÷å íîìåðà, äëÿ êîòîðîãî íåò ñëåäóþùåãî íîìåðà
- /// </summary>
- [Fact]
- public void TestGetNextMarkAfterOnNotNextMark()
- {
- Assert.Throws<Exception>(() => REG_MARK_LIB.REG_MARK_LIB.GetNextMarkAfter("x999xx52"));
- }
- /// <summary>
- /// Òåñò ôóíêöèè GetNextMarkAfterInRange, ïðè ïåðåäà÷å íå íîìåðà
- /// </summary>
- [Fact]
- public void TestGetNextMarkAfterInRangeOnNotMark()
- {
- Assert.Throws<ArgumentException>(() => REG_MARK_LIB.REG_MARK_LIB.GetNextMarkAfterInRange("Hello world!", "a999aa52", "a999aa52"));
- }
- /// <summary>
- /// Òåñò ôóíêöèè GetCombinationsCountInRange, ïðè ïåðåäà÷å íå íîìåðà
- /// </summary>
- [Fact]
- public void TestGetCombinationsCountInRangeOnNotMark()
- {
- Assert.Throws<ArgumentException>(() => REG_MARK_LIB.REG_MARK_LIB.GetCombinationsCountInRange("Hello world!", "a999aa52"));
- }
- }
- }
|