Example #1
0
        public void GetRank_RankMillionNumber_RankMillion(string input, Rank expectedRank)
        {
            NumericForProtectedMethodsTests numer = new NumericForProtectedMethodsTests(input);

            numer.Init();

            Assert.AreEqual(expectedRank, numer.Rank);
        }
Example #2
0
        public void GetRank_RankHundredNumber_RankHundred()
        {
            string expectedNumber = "987";
            Rank   expectedRank   = Rank.Hundred;

            string input = "987";
            NumericForProtectedMethodsTests numer = new NumericForProtectedMethodsTests(input);

            numer.Init();
            Assert.AreEqual(expectedNumber, numer.Number);
            Assert.AreEqual(expectedRank, numer.Rank);
        }
Example #3
0
        public void GetRank_Empty_RankDefault()
        {
            string expectedNumber = "";
            Rank   expectedRank   = Rank.Default;

            NumericForProtectedMethodsTests numer = new NumericForProtectedMethodsTests();

            numer.Init();

            Assert.AreEqual(expectedNumber, numer.Number);
            Assert.AreEqual(expectedRank, numer.Rank);
        }
Example #4
0
        public void GetRank_RankHundredNumberWithMiddleZeros_RankHundred()
        {
            string expectedNumber = "9009";
            Rank   expectedRank   = Rank.Thousand;

            string input = "9009";
            NumericForProtectedMethodsTests numer = new NumericForProtectedMethodsTests(input);

            numer.Init();

            Assert.AreEqual(expectedNumber, numer.Number);
            Assert.AreEqual(expectedRank, numer.Rank);
        }
Example #5
0
        public void GetRank_RankUnitNumberWithRightZeros_RankUnit()
        {
            string expectedNumber = "6";
            Rank   expectedRank   = Rank.Unit;

            string input = "06";
            NumericForProtectedMethodsTests numer = new NumericForProtectedMethodsTests(input);

            numer.Init();

            Assert.AreEqual(expectedNumber, numer.Number);
            Assert.AreEqual(expectedRank, numer.Rank);
        }
Example #6
0
        public void GetRank_SeveralZeroNumber_RankDefault()
        {
            string expectedNumber = "";
            Rank   expectedRank   = Rank.Default;

            string input = "000";
            NumericForProtectedMethodsTests numer = new NumericForProtectedMethodsTests(input);

            numer.Init();

            Assert.AreEqual(expectedNumber, numer.Number);
            Assert.AreEqual(expectedRank, numer.Rank);
        }
Example #7
0
        public void GetRank_RankTenNumberNTy_RankTen()
        {
            string expectedNumber = "90";
            Rank   expectedRank   = Rank.Ten;

            string input = "90";
            NumericForProtectedMethodsTests numer = new NumericForProtectedMethodsTests(input);

            numer.Init();

            Assert.AreEqual(expectedNumber, numer.Number);
            Assert.AreEqual(expectedRank, numer.Rank);
        }
Example #8
0
        public void Init_InitNumeric_ClearNumberAndAssignedRank()
        {
            string input        = "abc789cd 0 ";
            string expectedNum  = "7890";
            Rank   expectedRank = Rank.Thousand;

            NumericForProtectedMethodsTests numer = new NumericForProtectedMethodsTests(input);

            numer.Init();

            Assert.AreEqual(expectedNum, numer.Number);
            Assert.AreEqual(expectedRank, numer.Rank);
        }