Esempio n. 1
0
        public void MultipleCharacterStrings()
        {
            int endOffset = 0;

            byte[] content = Helper.ReadFixture("CharacterString", "www.google.com-string");
            IList <CharacterString> characterStrings = CharacterString.GetAllFromArray(content, 0, out endOffset);

            Assert.Equal(3, characterStrings.Count);
            Assert.Equal(15, endOffset);

            CharacterString characterString = characterStrings[0];

            Assert.Equal("www", characterString.ToString());
            Assert.Equal(4, characterString.Size);

            characterString = characterStrings[1];

            Assert.Equal("google", characterString.ToString());
            Assert.Equal(7, characterString.Size);

            characterString = characterStrings[2];

            Assert.Equal("com", characterString.ToString());
            Assert.Equal(4, characterString.Size);
        }
Esempio n. 2
0
        public void EmptyCharacterString()
        {
            CharacterString characterString = new CharacterString(new byte[0]);

            byte[] content = Helper.ReadFixture("CharacterString", "empty-string");

            Assert.Equal(content, characterString.ToArray());
            Assert.Equal("", characterString.ToString());
        }
Esempio n. 3
0
        public void SimpleCharacterString()
        {
            CharacterString characterString = new CharacterString("www");

            byte[] content = Helper.ReadFixture("CharacterString", "www-string");

            Assert.Equal(content, characterString.ToArray());
            Assert.Equal("www", characterString.ToString());
        }
Esempio n. 4
0
        public override void handle(LocalDevice localDevice, Address from, OctetString linkService)
        {
            // TODO RemoteDevice d = localDevice.getRemoteDeviceCreate(deviceIdentifier.getInstanceNumber(), from, linkService);
            RemoteObject o = new RemoteObject(objectIdentifier);

            o.ObjectName = objectName.ToString();
            // TODO d.setObject(o);

            // TODO localDevice.getEventHandler().fireIHaveReceived(d, o);
        }
Esempio n. 5
0
        public void EmptyCharacterString()
        {
            int endOffset = 0;

            byte[]          content         = Helper.ReadFixture("CharacterString", "empty-string");
            CharacterString characterString = CharacterString.FromArray(content, 0, out endOffset);

            Assert.Equal("", characterString.ToString());
            Assert.Equal(1, characterString.Size);
            Assert.Equal(1, endOffset);
        }
Esempio n. 6
0
        public void SimpleCharacterString()
        {
            int endOffset = 0;

            byte[]          content         = Helper.ReadFixture("CharacterString", "www-string");
            CharacterString characterString = CharacterString.FromArray(content, 0, out endOffset);

            Assert.Equal("www", characterString.ToString());
            Assert.Equal(4, characterString.Size);
            Assert.Equal(4, endOffset);
        }