private static void BytesNonGenericNullTest(IBytesSerializer serializer)
 {
     var type = typeof(TestModel);
     var bytes = serializer.ToBytes(type, null);
     var deserializeModel = serializer.FromBytes(type, bytes);
     Assert.Null(deserializeModel);
 }
Exemple #2
0
    private static void BytesGenericNullTest(IBytesSerializer serializer)
    {
        TestModel?model            = null;
        var       bytes            = serializer.ToBytes(model);
        var       deserializeModel = serializer.FromBytes <TestModel>(bytes);

        Assert.Null(deserializeModel);
    }
Exemple #3
0
    private static void BytesGenericTest(IBytesSerializer serializer, TestModel model)
    {
        var bytes            = serializer.ToBytes(model);
        var deserializeModel = serializer.FromBytes <TestModel>(bytes) !;

        Assert.Equal(
            Tuple.Create(model.Id, model.Age, model.CreateTime, model.Name, model.Gender),
            Tuple.Create(deserializeModel.Id, deserializeModel.Age, deserializeModel.CreateTime,
                         deserializeModel.Name, deserializeModel.Gender));
    }