diff options
author | Justin Clark-Casey (justincc) | 2011-11-14 20:56:56 +0000 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2011-11-14 20:56:56 +0000 |
commit | 89632f3ea8c355e5e860eb787aa21f90e79762d8 (patch) | |
tree | ff57923dd8ce7ca63e5b57bc2f2d05f745065691 /OpenSim/Region/CoreModules/Avatar/Friends/Tests/FriendModuleTests.cs | |
parent | Merge branch 'remove-scene-viewer' (diff) | |
download | opensim-SC_OLD-89632f3ea8c355e5e860eb787aa21f90e79762d8.zip opensim-SC_OLD-89632f3ea8c355e5e860eb787aa21f90e79762d8.tar.gz opensim-SC_OLD-89632f3ea8c355e5e860eb787aa21f90e79762d8.tar.bz2 opensim-SC_OLD-89632f3ea8c355e5e860eb787aa21f90e79762d8.tar.xz |
Add test for removing a friendship.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/Friends/Tests/FriendModuleTests.cs | 30 |
1 files changed, 25 insertions, 5 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/Tests/FriendModuleTests.cs b/OpenSim/Region/CoreModules/Avatar/Friends/Tests/FriendModuleTests.cs index c945dcf..682fbab 100644 --- a/OpenSim/Region/CoreModules/Avatar/Friends/Tests/FriendModuleTests.cs +++ b/OpenSim/Region/CoreModules/Avatar/Friends/Tests/FriendModuleTests.cs | |||
@@ -71,12 +71,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends.Tests | |||
71 | 71 | ||
72 | ScenePresence sp = SceneHelpers.AddScenePresence(m_scene, userId); | 72 | ScenePresence sp = SceneHelpers.AddScenePresence(m_scene, userId); |
73 | 73 | ||
74 | Assert.That(((TestClient)sp.ControllingClient).OfflineNotificationsReceived.Count, Is.EqualTo(0)); | 74 | Assert.That(((TestClient)sp.ControllingClient).ReceivedOfflineNotifications.Count, Is.EqualTo(0)); |
75 | Assert.That(((TestClient)sp.ControllingClient).OnlineNotificationsReceived.Count, Is.EqualTo(0)); | 75 | Assert.That(((TestClient)sp.ControllingClient).ReceivedOnlineNotifications.Count, Is.EqualTo(0)); |
76 | } | 76 | } |
77 | 77 | ||
78 | [Test] | 78 | [Test] |
79 | public void TestAddFriendWhileOnline() | 79 | public void TestAddFriendshipWhileOnline() |
80 | { | 80 | { |
81 | TestHelpers.InMethod(); | 81 | TestHelpers.InMethod(); |
82 | // log4net.Config.XmlConfigurator.Configure(); | 82 | // log4net.Config.XmlConfigurator.Configure(); |
@@ -91,8 +91,28 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends.Tests | |||
91 | // notification. | 91 | // notification. |
92 | m_fm.AddFriendship(sp.ControllingClient, user2Id); | 92 | m_fm.AddFriendship(sp.ControllingClient, user2Id); |
93 | 93 | ||
94 | Assert.That(((TestClient)sp.ControllingClient).OfflineNotificationsReceived.Count, Is.EqualTo(0)); | 94 | Assert.That(((TestClient)sp.ControllingClient).ReceivedOfflineNotifications.Count, Is.EqualTo(0)); |
95 | Assert.That(((TestClient)sp.ControllingClient).OnlineNotificationsReceived.Count, Is.EqualTo(1)); | 95 | Assert.That(((TestClient)sp.ControllingClient).ReceivedOnlineNotifications.Count, Is.EqualTo(1)); |
96 | } | ||
97 | |||
98 | [Test] | ||
99 | public void TestRemoveFriendshipWhileOnline() | ||
100 | { | ||
101 | TestHelpers.InMethod(); | ||
102 | // log4net.Config.XmlConfigurator.Configure(); | ||
103 | |||
104 | UUID user1Id = TestHelpers.ParseTail(0x1); | ||
105 | UUID user2Id = TestHelpers.ParseTail(0x2); | ||
106 | |||
107 | ScenePresence sp = SceneHelpers.AddScenePresence(m_scene, user1Id); | ||
108 | SceneHelpers.AddScenePresence(m_scene, user2Id); | ||
109 | |||
110 | m_fm.AddFriendship(sp.ControllingClient, user2Id); | ||
111 | m_fm.RemoveFriendship(sp.ControllingClient, user2Id); | ||
112 | |||
113 | TestClient user1Client = sp.ControllingClient as TestClient; | ||
114 | Assert.That(user1Client.ReceivedFriendshipTerminations.Count, Is.EqualTo(1)); | ||
115 | Assert.That(user1Client.ReceivedFriendshipTerminations[0], Is.EqualTo(user2Id)); | ||
96 | } | 116 | } |
97 | } | 117 | } |
98 | } \ No newline at end of file | 118 | } \ No newline at end of file |