Ejemplo n.º 1
0
        public static TestStructure1 CreateTest()
        {
            var t = new TestStructure1()
            {
                Text1         = "dsdfsdf,",
                Text2         = "ds sdfsdf",
                Text3         = "fsd",
                DateTime      = new DateTime(1975, 01, 01),
                StartActivity = true, FinishActivity = true, Input = true, Output = false, Verbose = true, UseBufferForVerbose = true, VerboseWithStackTrace = true
            };

            return(t);
        }
Ejemplo n.º 2
0
        public void ServiceStackDynamicJsonWithParsing()
        {
            var     json = GetJson();
            dynamic d    = DynamicJson.Deserialize(json);
            var     t    = new TestStructure1()
            {
                StartActivity         = bool.Parse(d.StartActivity),
                FinishActivity        = bool.Parse(d.FinishActivity),
                Input                 = bool.Parse(d.Input),
                Output                = bool.Parse(d.Output),
                Verbose               = bool.Parse(d.Verbose),
                UseBufferForVerbose   = bool.Parse(d.UseBufferForVerbose),
                VerboseWithStackTrace = bool.Parse(d.VerboseWithStackTrace)
            };

            if (t == null)
            {
                throw new ApplicationException("Test fails");
            }
        }