Skip to content

AII Dict not accessible from "outside" #2

@tbird2017

Description

@tbird2017

I made a Property to access the internally held AIIDict to the "outside world".

public static SortedDictionary<string, AII> AIIDictionary { get { return aiiDict; } }

This makes life easier in using the code in different classes and unit tests, e.g.

 public void TestStandardGS1Code()
        {
            string code = $"0112345678901234211234567890123456789{(char)29}2401234567";

            var result = GS1Parser.GS1.Parse(code);

            Assert.IsTrue(result.Count == 3);        
            Assert.AreEqual("12345678901234", result[GS1Parser.GS1.AIIDictionary["01"]]);
            Assert.AreEqual("69P17ZZ083500044300", result[GS1Parser.GS1.AIIDictionary["21"]]);
            Assert.AreEqual("1234567", result[GS1Parser.GS1.AIIDictionary["240"]]);
        }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions