Beispiel #1
0
        private void TestOneDataRow(string inputString, IEnumerable <bool> expected)
        {
            EncoderBase        target       = CreateEncoder();
            IEnumerable <bool> actualResult = target.GetDataBits(inputString);

            BitVectorTestExtensions.CompareIEnumerable(actualResult, expected, "Nunit");
        }
    internal static EncodationStruct Encode(string content, ErrorCorrectionLevel ecLevel)
    {
        RecognitionStruct recognitionResult = InputRecognise.Recognise(content);
        EncoderBase       encoderBase       = CreateEncoder(recognitionResult.EncodingName);

        BitList encodeContent = encoderBase.GetDataBits(content);

        int encodeContentLength = encodeContent.Count;

        VersionControlStruct vcStruct =
            VersionControl.InitialSetup(encodeContentLength, ecLevel, recognitionResult.EncodingName);

        BitList dataCodewords = new();

        // Eci header
        if (vcStruct.IsContainECI && vcStruct.ECIHeader is { })