Files
mono/mcs/class/System.Runtime.Serialization/Test/System.Xml/UniqueIdTest.cs
T
Jb Evain 8b9722d103 move to from olive to mcs
svn path=/trunk/mcs/; revision=111184
2008-08-20 21:22:38 +00:00

44 lines
818 B
C#

using System;
using System.Xml;
using NUnit.Framework;
namespace MonoTests.System.ServiceModel
{
[TestFixture]
public class UniqueIdTest
{
[Test]
public void TestDefault ()
{
UniqueId id = new UniqueId ();
Assert.IsTrue (id.IsGuid, "#1");
Guid g = Guid.NewGuid ();
UniqueId a = new UniqueId (g);
UniqueId b = new UniqueId (g.ToByteArray ());
Assert.AreEqual (a, b, "#2");
Assert.AreEqual ("urn:uuid:", a.ToString ().Substring (0, 9), "#3");
a = new UniqueId ("foo");
Assert.AreEqual ("foo", a.ToString (), "#4");
}
[Test]
[ExpectedException (typeof (FormatException))]
public void ZeroLengthCtor ()
{
new UniqueId ("");
}
[Test]
[ExpectedException (typeof (ArgumentNullException))]
public void CtorNull1 ()
{
new UniqueId ((string) null);
}
}
}