Exemplo n.º 1
0
        public void EnIsSimple()
        {
            String expectedEn = "abcd";
            String expectedIs = "abce";

            byte[]        buffer = RecordBytesEnIs;
            ServiceRecord record = new ServiceRecordParser().Parse(buffer);

            LanguageBaseItem[] langList = record.GetLanguageBaseList();
            //
            LanguageBaseItem langIs = langList[0];

            Assert.AreEqual("is", langIs.NaturalLanguage);
            LanguageBaseItem langEn = langList[1];

            Assert.AreEqual("en", langEn.NaturalLanguage);
            //
            ServiceAttribute attrEn = record.GetAttributeByIndex(1);
            ServiceAttribute attrIs = record.GetAttributeByIndex(2);

            Assert.AreEqual((ServiceAttributeId)0x0100, attrEn.Id);
            Assert.AreEqual((ServiceAttributeId)0x0110, attrIs.Id);
            String resultEn = attrEn.Value.GetValueAsString(langEn);
            String resultIs = attrIs.Value.GetValueAsString(langIs);

            Assert.AreEqual(expectedEn, resultEn);
            Assert.AreEqual(expectedIs, resultIs);
        }