public void Test7_3To10_10digit_all2() { int exp = 59048; UserRightsManage.TreeTenConverter conv = new UserRightsManage.TreeTenConverter("2222222222", false); int act = conv.rightsNumberInTen; Assert.AreEqual(exp, act, "Not correct converting"); }
public void Test6_3To10_10digit_null() { int exp = 0; UserRightsManage.TreeTenConverter conv = new UserRightsManage.TreeTenConverter("0000000000", false); int act = conv.rightsNumberInTen; Assert.AreEqual(exp, act, "Not correct converting"); }
public void Test5_3To10_10digit_some3() { int exp = 8884; UserRightsManage.TreeTenConverter conv = new UserRightsManage.TreeTenConverter("0110012001", false); int act = conv.rightsNumberInTen; Assert.AreEqual(exp, act, "Not correct converting"); }
public void Test16_10To3_10digit_all0() { string exp = "0000000000"; UserRightsManage.TreeTenConverter conv = new UserRightsManage.TreeTenConverter("0", true); string act = conv.rightsNumberInThree; Assert.AreEqual(exp, act, "Not correct converting"); }
public void Test8_3To10_10digit_wrongDigits() { try { UserRightsManage.TreeTenConverter conv = new UserRightsManage.TreeTenConverter("2345522228", false); Assert.Fail("Not correct converting - not recognizes formatErr"); } catch (ErrorUserRightFormat err) { if (err.Message != "A program hibát vétett, nem 3SZR-beni számértéket ad") { Assert.Fail("Wrong error message"); } } }
public void Test12_3To10_13digit_wrongSize() { try { UserRightsManage.TreeTenConverter conv = new UserRightsManage.TreeTenConverter("1012101210121", false); Assert.Fail("Not correct converting - not recognizes lengthErr"); } catch (ErrorUserRightLength err) { if (err.Message != "A program hibát vétett, a szükségesnál hosszabb 3SZR-beni értéket ad") { Assert.Fail("Wrong error message"); } } }
public void Test19_10To3_10digit_decimal() { try { UserRightsManage.TreeTenConverter conv = new UserRightsManage.TreeTenConverter("10.21", true); string act = conv.rightsNumberInThree; Assert.Fail("Not sends error for too great decimal number"); } catch (ErrorUserRightFormat urfe) { if (urfe.getMessage() != "Az adatbázis sérült, jogosultság mezőben nem egész szám van") { Assert.Fail("Not correct errormessage is arrived"); } } catch (Exception e) { Assert.Fail("Not correct errortype is arrived"); } }