Ejemplo n.º 1
0
        public void TestAddAuth()
        {
            long authCode = 0;

            for (int i = 1; i <= 62; i++)
            {
                long x = BinAuth.GetBinPower(i);
                authCode = BinAuth.AddAuth(authCode, x);
            }
            Assert.Equal(9223372036854775806, authCode);
        }
Ejemplo n.º 2
0
        public void TestIsHasAuth()
        {
            long authCode = 0;

            for (int i = 1; i <= 62; i++)
            {
                long x = BinAuth.GetBinPower(i);
                authCode = BinAuth.AddAuth(authCode, x);
                BinAuth.IsHasAuth(authCode, x).Should().BeTrue();
            }

            for (int i = 1; i <= 62; i++)
            {
                BinAuth.IsHasAuth(authCode, BinAuth.GetBinPower(i)).Should().BeTrue();
            }

            BinAuth.IsHasAuth(-1, 0).Should().BeFalse();
            BinAuth.IsHasAuth(0, 0).Should().BeFalse();
        }