示例#1
0
        public void ToBytes_4ServicesInput_NullOutput()
        {
            // Arrange
            STTInterpreter stt = new STTInterpreter();

            ServiceInfo[] array = generateServiceInfoArray(4, true, true);

            // Act
            byte[] output = stt.ToBytes(array);

            // Assert
            Assert.AreEqual(null, output);
        }
示例#2
0
        public void ToBytes_40ServicesInput_10BytesOutput()
        {
            // Arrange
            STTInterpreter stt = new STTInterpreter();

            ServiceInfo[] array = generateServiceInfoArray(40, true, true);

            // Act
            byte[] output = stt.ToBytes(array);

            // Assert
            Assert.AreEqual(10, output.Length);
        }
示例#3
0
        public void ToBytes_EmptyInput_NullOutput()
        {
            // Arrange
            STTInterpreter stt = new STTInterpreter();

            ServiceInfo[] array = new ServiceInfo[0];

            // Act
            byte[] output = stt.ToBytes(array);

            // Assert
            Assert.AreEqual(null, output);
        }
示例#4
0
        public void ToBytes_ServicesNotAllocatedNorActivated_AllBytesZero()
        {
            // Arrange
            STTInterpreter stt = new STTInterpreter();

            ServiceInfo[] array = generateServiceInfoArray(40, false, false);

            // Act
            byte[] output = stt.ToBytes(array);

            // Assert
            foreach (byte b in output)
            {
                Assert.AreEqual(0, b);
            }
        }
示例#5
0
        public void ToBytes_ServicesAllocatednActivated_AllBytesOne()
        {
            // Arrange
            STTInterpreter stt = new STTInterpreter();

            ServiceInfo[] array = generateServiceInfoArray(40, true, true);

            // Act
            byte[] output = stt.ToBytes(array);

            // Assert
            foreach (byte b in output)
            {
                Assert.AreEqual(255, b);
            }
        }