public void LongEncode_CanEncodeLong()
        {
            // Arrange
            var encoder = new LongEncode(ValidSecret);
            var expected = (long)123456789;

            // Act
            var result = encoder.Encode(expected);

            // Assert
            Assert.NotEmpty(result);
        }
Example #2
0
        public void LongEncode_CanEncodeLong()
        {
            // Arrange
            var encoder  = new LongEncode(ValidSecret);
            var expected = (long)123456789;

            // Act
            var result = encoder.Encode(expected);

            // Assert
            Assert.NotEmpty(result);
        }
        public void LongEncode_CanDecodeEncodedLong()
        {
            // Arrange
            var encoder = new LongEncode(ValidSecret);
            var expected = (long)123456789;

            // Act
            var encoded = encoder.Encode(expected);
            var result = encoder.Decode(encoded);

            // Assert
            Assert.Equal(expected, result);
        }
Example #4
0
        public void LongEncode_CanDecodeEncodedLong()
        {
            // Arrange
            var encoder  = new LongEncode(ValidSecret);
            var expected = (long)123456789;

            // Act
            var encoded = encoder.Encode(expected);
            var result  = encoder.Decode(encoded);

            // Assert
            Assert.Equal(expected, result);
        }
        public void LongEncode_CantDecodeDecodWithInvalidSecret()
        {
            // Arrange
            var validEncoder = new LongEncode(ValidSecret);
            var invalidEncoder = new LongEncode(InvalidSecret);
            var expected = (long)123456789;

            // Act
            var encoded = validEncoder.Encode(expected);
            var result = invalidEncoder.Decode(encoded);

            // Assert
            Assert.NotEqual(expected, result);
        }
Example #6
0
        public void LongEncode_CantDecodeDecodWithInvalidSecret()
        {
            // Arrange
            var validEncoder   = new LongEncode(ValidSecret);
            var invalidEncoder = new LongEncode(InvalidSecret);
            var expected       = (long)123456789;

            // Act
            var encoded = validEncoder.Encode(expected);
            var result  = invalidEncoder.Decode(encoded);

            // Assert
            Assert.NotEqual(expected, result);
        }