Example #1
0
        public void ConfigInlineTupleSerializer_TupleType_JsConfigFuncsSet()
        {
            // locking in case tests are multi threaded.
            lock (StaticTestingLocks.JsConfigLockObject)
            {
                JsConfig <Tuple <string, string> > .Reset();

                var proxy = new TupleSerializerInitializerProxy();
                proxy.ConfigInlineTupleSerializer(typeof(Tuple <string, string>), null);

                Assert.Equal("GetStringValue", JsConfig <Tuple <string, string> > .SerializeFn.Method.Name);
                Assert.Equal("GetTupleFrom", JsConfigFnTargetResolver <Tuple <string, string> > .GetDeserializer().Method.Name);
            }
        }
        public void Configure_SingularTupleType_JsConfigFunctionsSet()
        {
            lock (StaticTestingLocks.JsConfigLockObject)
            {
                JsConfig <Tuple <string, string, string> > .Reset();

                new TupleSerializerConfigurator()
                .WithTupleTypes(new List <Type> {
                    typeof(Tuple <string, string, string>)
                })
                .Configure();

                Assert.Equal("GetStringValue", JsConfig <Tuple <string, string, string> > .SerializeFn.Method.Name);
                Assert.Equal("GetTupleFrom",
                             JsConfigFnTargetResolver <Tuple <string, string, string> > .GetDeserializer().Method.Name);
            }
        }