1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889 |
- using DllforTesting;
- namespace UnitTestForDLL
- {
- public class UnitTest1
- {
- #region Íèçêîé ñëîæíîñòè
- [Fact]
- public void CheckMarkOnTrue()
- {
- Assert.True(Class1.CheckMark("A123CA777"));
- }
- [Fact]
- public void CheckMarkOnFalse()
- {
- Assert.False(Class1.CheckMark("A123CA808"));
- }
- [Fact]
- public void CheckMarkOnNull()
- {
- Assert.NotNull(Class1.CheckMark("A123CA731"));
- }
- [Fact]
- public void CheckRegionsCollection()
- {
- Assert.NotEmpty(Class1.regions);
- }
- [Fact]
- public void CheckNextMark()
- {
- Assert.IsType<string>(Class1.GetNextMarkAfter("B456BX052"));
- }
- [Fact]
- public void CheckNextMarkInRange()
- {
- Assert.IsType<string>(Class1.GetNextMarkAfterInRange("B456BX052", "B101BX052", "B952BX052"));
- }
- [Fact]
- public void CheckCountCombination()
- {
- Assert.Equal(3, Class1.GetCombinationsCountInRange("B101BX052", "B103BX052"));
- }
- [Fact]
- public void CheckMark()
- {
- Assert.Equal(true, Class1.CheckMark("B101BX052"));
- }
- [Fact]
- public void CheckNextMarkAfter()
- {
- Assert.Equal("B102BX052", Class1.GetNextMarkAfter("B101BX052"));
- }
- [Fact]
- public void CheckNextMarkAfterInRangeEqual()
- {
- Assert.Equal("B103BX052", Class1.GetNextMarkAfterInRange("B102BX052", "B101BX052", "B103BX052"));
- }
- #endregion
- #region Âûñîêîé ñëîæíîñòè
- [Fact]
- public void NullArgumentOnCheck()
- {
- Assert.Throws<ArgumentException>(() => Class1.CheckMark(null));
- }
- [Fact]
- public void NullArgumentOnNext()
- {
- Assert.Throws<ArgumentException>(() => Class1.GetNextMarkAfter(null));
- }
- [Fact]
- public void NullArgumentOnRange()
- {
- Assert.Throws<ArgumentException>(() => Class1.GetNextMarkAfterInRange(null,null,null));
- }
- [Fact]
- public void NullArgumentOnCount()
- {
- Assert.Throws<ArgumentException>(() => Class1.GetCombinationsCountInRange(null,null));
- }
- [Fact]
- public void WrongArgumentOnCheck()
- {
- Assert.Throws<ArgumentException>(() => Class1.CheckMark("A4560BC1233"));
- }
- #endregion
- }
- }
|