コード例 #1
0
        public static void TestAuthChallengeMsg_GetChallenge_NotNull()
        {
            var challengeMsg = new AuthChallengeMsg();
            var challenge    = challengeMsg.GetChallenge();

            Assert.NotNull(challenge);
        }
コード例 #2
0
        public static void TestAuthChallengeMsg_ToByteArray_CorrectSize()
        {
            var challengeMsg = new AuthChallengeMsg();
            var packet       = challengeMsg.ToByteArray();

            Assert.AreEqual(MESSAGE_SIZE, packet.Length);
        }
コード例 #3
0
        public static void TestAuthChallengeMsg_GetChallenge_NotZeros()
        {
            var challengeMsg = new AuthChallengeMsg();
            var challenge    = challengeMsg.GetChallenge();

            Assert.AreNotEqual(new byte[PHRASE_SIZE], challenge);
        }
コード例 #4
0
        public static void TestAuthChallengeMsg_GetChallenge_CorrectSize()
        {
            var challengeMsg = new AuthChallengeMsg();
            var challenge    = challengeMsg.GetChallenge();

            Assert.AreEqual(PHRASE_SIZE, challenge.Length);
        }
コード例 #5
0
        public static void TestAuthChallengeMsg_ToByteArray_CorrectHeader()
        {
            var challengeMsg = new AuthChallengeMsg();
            var packet       = challengeMsg.ToByteArray();

            Assert.AreEqual(PACKET_IDENTIFIER, packet[0]);
        }
コード例 #6
0
        public static void TestAuthChallengeMsg_ToByteArray_NotNull()
        {
            var challengeMsg = new AuthChallengeMsg();
            var packet       = challengeMsg.ToByteArray();

            Assert.NotNull(packet);
        }
コード例 #7
0
        public static void TestAuthChallengeMsg_ToByteArray_ContainsChallenge()
        {
            var challengeMsg    = new AuthChallengeMsg();
            var challenge       = challengeMsg.GetChallenge();
            var packet          = challengeMsg.ToByteArray();
            var packetChallenge = new byte[PHRASE_SIZE];

            Buffer.BlockCopy(packet, PHRASE_LOCATION, packetChallenge, 0, PHRASE_SIZE);

            Assert.AreEqual(challenge, packetChallenge);
        }
コード例 #8
0
        public static void TestAuthChallengeMsg_ToByteArray_DoesNotThrow()
        {
            var challengeMsg = new AuthChallengeMsg();

            Assert.DoesNotThrow(() => challengeMsg.ToByteArray());
        }
コード例 #9
0
        public static void TestAuthChallengeMsg_GetChallenge_DoesNotThrow()
        {
            var challengeMsg = new AuthChallengeMsg();

            Assert.DoesNotThrow(() => challengeMsg.GetChallenge());
        }