Пример #1
0
        public void Add_WithReplace()
        {
            Byte newCode = 2;

            Random random = new Random();

            Byte[] value = random.NextBytes(20);
            Byte[] input = new byte[2 + value.Length];
            input[0] = 0;
            input[1] = newCode;
            value.CopyTo(input, 2);

            DUIDFactory.AddDUIDType(newCode, (input) => new FakeDUID(), true);

            var duid = DUIDFactory.GetDUID(input);

            Assert.NotNull(duid);
            Assert.IsAssignableFrom <FakeDUID>(duid);
        }
Пример #2
0
 public void Add_AlreadyExists()
 {
     Assert.ThrowsAny <Exception>(() =>
                                  DUIDFactory.AddDUIDType(1, (input) => new FakeDUID(), false));
 }