Exemple #1
0
        public void VerifyIL()
        {
            var model = RuntimeTypeModel.Create();

            model.Add <NewHtmlString>();
            model.Add <Item>();
            PEVerify.CompileAndVerify(model, "NewHtmlStringModel", deleteOnSuccess: false);
        }
        public void CheckLayoutEquivalence_Valid()
        {
            var data  = GetNamedTupleData();
            var model = RuntimeTypeModel.Create();

            model.Add(data.GetType());
            PEVerify.CompileAndVerify(model);
        }
Exemple #3
0
        public void CanUseSurrogateForScalarPassThru()
        {
            var model = RuntimeTypeModel.Create();

            model.AutoCompile = false;
            model.SetSurrogate <CustomerID, int>(ToInt32, ToCustomerID, DataFormat.ZigZag, CompatibilityLevel.Level300);

            Execute(model);                                                    // runtime-only
            model.CompileInPlace();
            Execute(model);                                                    // in-place compile
            Execute(model.Compile());                                          // in-proc compile
            Execute(PEVerify.CompileAndVerify(model, deleteOnSuccess: false)); // on-disk compile
        public void CustomProtogenSerializer()
        {
            var model = RuntimeTypeModel.Create();

            model.Add <FileDescriptorSet>();
            model.Add <Access>();
            model.Add <ProtogenFileOptions>();
            model.Add <ProtogenMessageOptions>();
            model.Add <ProtogenFieldOptions>();
            model.Add <ProtogenEnumOptions>();
            model.Add <ProtogenEnumValueOptions>();
            model.Add <ProtogenServiceOptions>();
            model.Add <ProtogenMethodOptions>();
            model.Add <ProtogenOneofOptions>();
            PEVerify.CompileAndVerify(model, deleteOnSuccess: false);
        }