public void TestAdd() { RosterManager rm = new RosterManager(); RosterIQ riq = new RosterIQ(doc); riq.Type = IQType.set; Roster r = riq.Instruction; Item i = r.AddItem(); i.JID = new JID("foo", "bar", null); i.Nickname = "FOO"; i.Subscription = Subscription.both; rm.AddRoster(riq); Assert.AreEqual(Subscription.both, rm["foo@bar"].Subscription); Assert.AreEqual("FOO", rm["foo@bar"].Nickname); riq = new RosterIQ(doc); riq.Type = IQType.set; r = riq.Instruction; i = r.AddItem(); i.JID = new JID("foo", "bar", null); i.Nickname = "BAR"; i.Subscription = Subscription.to; rm.AddRoster(riq); Assert.AreEqual(Subscription.to, rm["foo@bar"].Subscription); Assert.AreEqual("BAR", rm["foo@bar"].Nickname); }
public void TestNumeric() { RosterManager rm = new RosterManager(); RosterIQ riq = new RosterIQ(doc); riq.Type = IQType.set; Roster r = riq.Instruction; Item i = r.AddItem(); i.JID = new JID("support", "conference.192.168.32.109", null); i.Nickname = "FOO"; i.Subscription = Subscription.both; rm.AddRoster(riq); Assert.AreEqual(Subscription.both, rm["[email protected]"].Subscription); Assert.AreEqual("FOO", rm["[email protected]"].Nickname); }
public void Test_Create() { RosterManager rm = new RosterManager(); Assert.AreEqual("jabber.client.RosterManager", rm.GetType().FullName); }