123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110 |
- using VINLIB;
- namespace VINTEST
- {
- [TestClass]
- public class UnitTest
- {
- VINLIB.Class1 class1 = new VINLIB.Class1();
- [TestMethod]
- public void LenghtVin()
- {
- int except = 17;
- int actual = class1.vin.Length;
- Assert.AreEqual(except, actual);
- }
- [TestMethod]
- public void ExceptionsVin()
- {
- class1.VIN();
- bool except = class1.vin.Contains('O');
- except = class1.vin.Contains('Q');
- except = class1.vin.Contains('I');
- Assert.IsFalse(except);
- }
- [TestMethod]
- public void Country()
- {
- class1.WMI();
- bool except = true;
- if (class1.vin[0] == '0')
- {
- except = false;
- }
- Assert.IsTrue(except);
- }
- [TestMethod]
- public void TheLust4()
- {
- class1.VIS();
- bool except = false;
- for (int i = 13; i < 16; i++)
- {
- if (class1.vin[i] >= '0' && class1.vin[i] <= '9')
- {
- except = true;
- }
- }
- Assert.IsTrue(except);
- }
- [TestMethod]
- public void VIN9_1()
- {
- string str = "JHMCM56557C404453";
- class1.vin = str.ToCharArray();
- class1.CHK();
- int except = 368;
- int actual = class1.a;
- Assert.AreEqual(except, actual);
- }
- [TestMethod]
- public void VIN9_2()
- {
- string str = "JHMCM56557C404453";
- class1.vin = str.ToCharArray();
- class1.CHK();
- int except = 363;
- int actual = class1.c;
- Assert.AreEqual(except, actual);
- }
- [TestMethod]
- public void VIN9_3()
- {
- string str = "JHMCM56557C404453";
- class1.vin = str.ToCharArray();
- class1.CHK();
- int except = 5;
- int actual = class1.d;
- Assert.AreEqual(except, actual);
- }
- [TestMethod]
- public void VIN9__10()
- {
- string str = "JHMDM56557C404453";
- class1.vin = str.ToCharArray();
- class1.CHK();
- char except = 'X';
- char actual = class1.vin[8];
- Assert.AreEqual(except, actual);
- }
- [TestMethod]
- public void VIN9__A()
- {
- bool except = false;
- string str = "JHMDM565H7C404453";
- class1.vin = str.ToCharArray();
- if (class1.vin[8] >= '0' && class1.vin[8] <= '9' || class1.vin[8] == 'X')
- {
- except = true;
- }
- Assert.IsFalse(except);
- }
- }
- }
|