Пример #1
0
        public void It_should_replace_tuples_with_same_id()
        {
            var doc = new PresenceDocument("*****@*****.**");

            doc.Modify(0, GetPresenceBytes("<tuple id='1'></tuple>"));
            doc.Modify(1, GetPresenceBytes("<tuple id='1'><new/></tuple>"));

            AreEqual("<tuple id='1' xmlns='urn:ietf:params:xml:ns:pidf'><new /></tuple>", doc);
        }
Пример #2
0
        public void It_should_remove_tuples_if_it_absent_in_new_request()
        {
            var doc = new PresenceDocument("*****@*****.**");

            doc.Modify(0, GetPresenceBytes("<tuple id='1'></tuple>"));
            doc.Modify(0, GetPresenceBytes("<tuple id='2'></tuple>"));

            AreEqual("<tuple id='2' xmlns='urn:ietf:params:xml:ns:pidf'></tuple>", doc);
        }
Пример #3
0
        public void It_should_remove_tuples_by_sipIfMatch()
        {
            var doc = new PresenceDocument("*****@*****.**");

            doc.Modify(0, GetPresenceBytes("<tuple id='1'></tuple><tuple id='2'></tuple>"));
            doc.Modify(1, GetPresenceBytes("<tuple id='2'></tuple>"));
            doc.Remove(0);

            AreEqual("<tuple id='2' xmlns='urn:ietf:params:xml:ns:pidf'></tuple>", doc);
        }