Пример #1
0
        public void ByteArrays()
        {
            var x = Util.Generate(1024, i => (byte)(i % 256));

            RoundTripTest.Run(x);
            RoundTripTest.Run(x.SubArray(256));
            RoundTripTest.Run((byte[])null);
        }
Пример #2
0
 public void Hodgepodge()
 {
     TestTypeRegistrationHelpers.RegisterWithSerializer <HodgepodgeDto>();
     RoundTripTest.Run(new HodgepodgeDto {
         True           = true,
         False          = false,
         Int8           = CreatePlaceholder <sbyte>(),
         Int16          = CreatePlaceholder <short>(),
         Int32          = CreatePlaceholder <int>(),
         String         = CreatePlaceholder <string>(),
         Guid           = CreatePlaceholder <Guid>(),
         IntList        = CreatePlaceholder <List <int> >(),
         IntPowersArray = Enumerable.Range(-31, 31).Select(i => Math.Sign(i) * (1 << Math.Abs(i))).Concat(new [] { int.MinValue, int.MaxValue }).ToArray(),
         StringArray    = CreatePlaceholder <string[]>(),
         IntStringMap   = CreatePlaceholder <Dictionary <int, string> >(),
         IntStringStringArrayMapArrayMap = CreatePlaceholder <Dictionary <int, Dictionary <string, string[]>[]> >(),
         Type     = typeof(LinkedListNode <int>),
         DateTime = DateTime.FromFileTime(2131891),
         Float    = CreatePlaceholder <float>(),
         Double   = CreatePlaceholder <double>(),
     });
 }
Пример #3
0
 public void Guids()
 {
     RoundTripTest.Run(Guid.NewGuid());
 }
Пример #4
0
 public void False() => RoundTripTest.Run(false);
Пример #5
0
 public void True() => RoundTripTest.Run(true);
Пример #6
0
 private void LinkedList_RunTest <T>(LinkedListNode <T> node)
 {
     RoundTripTest.Run(node);
 }