aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Tests/UtilTest.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Framework/Tests/UtilTest.cs')
-rw-r--r--OpenSim/Framework/Tests/UtilTest.cs18
1 files changed, 18 insertions, 0 deletions
diff --git a/OpenSim/Framework/Tests/UtilTest.cs b/OpenSim/Framework/Tests/UtilTest.cs
index c5f1800..341cd81 100644
--- a/OpenSim/Framework/Tests/UtilTest.cs
+++ b/OpenSim/Framework/Tests/UtilTest.cs
@@ -25,6 +25,7 @@
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */ 26 */
27 27
28using System;
28using NUnit.Framework; 29using NUnit.Framework;
29using NUnit.Framework.SyntaxHelpers; 30using NUnit.Framework.SyntaxHelpers;
30using OpenMetaverse; 31using OpenMetaverse;
@@ -152,5 +153,22 @@ namespace OpenSim.Framework.Tests
152 Assert.IsFalse(Util.isUUID("01234567-89ab-Cdef-0123+456789AbCdEf"), 153 Assert.IsFalse(Util.isUUID("01234567-89ab-Cdef-0123+456789AbCdEf"),
153 "UUIDs with wrong format are recognized as correct UUIDs."); 154 "UUIDs with wrong format are recognized as correct UUIDs.");
154 } 155 }
156
157 [Test]
158 public void GetHashGuidTests()
159 {
160 string string1 = "This is one string";
161 string string2 = "This is another";
162
163 // Two consecutive runs should equal the same
164 Assert.AreEqual(Util.GetHashGuid(string1, "secret1"), Util.GetHashGuid(string1, "secret1"));
165 Assert.AreEqual(Util.GetHashGuid(string2, "secret1"), Util.GetHashGuid(string2, "secret1"));
166
167 // Varying data should not eqal the same
168 Assert.AreNotEqual(Util.GetHashGuid(string1, "secret1"), Util.GetHashGuid(string2, "secret1"));
169
170 // Varying secrets should not eqal the same
171 Assert.AreNotEqual(Util.GetHashGuid(string1, "secret1"), Util.GetHashGuid(string1, "secret2"));
172 }
155 } 173 }
156} 174}