Example #1
0
        public void Encode_Guid_CompactGuidRepresentation()
        {
            string compact     = CompactGuid.Encode(GuidBuilder.Build(1));
            string compactOnes = "EREREREREREREREREREREQ";

            Assert.That(compact, Is.EqualTo(compactOnes));
        }
Example #2
0
        public void Encode_String_CompactsGuidRepresentation()
        {
            string representation = shortestRepresentation(GuidBuilder.Build(1));

            string compact     = CompactGuid.Encode(representation);
            string compactOnes = "EREREREREREREREREREREQ";

            Assert.That(compact, Is.EqualTo(compactOnes));
        }
Example #3
0
        public void Explore()
        {
            var subject = new CompactGuid(Guid.Empty);

            subject = new CompactGuid("EREREREREREREREREREREQ");

            Guid ones = GuidBuilder.Build(1);

            subject = new CompactGuid(ones);
            Assert.That(subject.Value, Is.EqualTo("EREREREREREREREREREREQ"));

            subject = new CompactGuid(ones);
            Assert.That(subject.Value, Is.EqualTo("EREREREREREREREREREREQ"));

            subject = new CompactGuid("EREREREREREREREREREREQ");
            Assert.That(subject.Guid, Is.EqualTo(ones));

            string representation = CompactGuid.Encode(ones);

            Assert.That(representation, Is.EqualTo("EREREREREREREREREREREQ"));
            Assert.That(CompactGuid.Decode(representation), Is.EqualTo(ones));
        }
Example #4
0
 public void Encode_NotAGuid_Exception()
 {
     Assert.That(() => CompactGuid.Encode("notAGuid"), Throws.InstanceOf <FormatException>());
 }