public void FromUriMatchesToUri() { string uri = "urn:epc:tag:sgtin-96:1.311112347.0781321.1"; var tag = Sgtin96Tag.FromUri(uri); Assert.AreEqual(uri, tag.ToString(), "uri != tag.ToString()"); Assert.AreEqual(uri, tag.ToUri().ToString(), "uri != tag.ToUri().ToString()"); }
public void FromUriSucceeds() { string uri = "urn:epc:tag:sgtin-96:1.311112347.0781321.1"; var tag = Sgtin96Tag.FromUri(uri); Assert.AreEqual(1, tag.Filter, "Filter"); Assert.AreEqual("311112347", tag.CompanyPrefix, "CompanyPrefix"); Assert.AreEqual("0781321", tag.IndicatorAndItemReference, "IndicatorAndItemReference"); Assert.AreEqual("0", tag.Indicator, "Indicator"); Assert.AreEqual("781321", tag.ItemReference, "ItemReference"); Assert.AreEqual("1", tag.Serial, "Serial"); Assert.AreEqual(uri, tag.ToUri().ToString(), "uri != tag.ToUri().ToString()"); }