public void TestRockJsonSerializerOnTraceInfo()
        {
            var traceMessage = new Dictionary <string, string>();

            traceMessage.Add("Level", TraceLevel.Verbose.ToString());
            traceMessage.Add("Message", "Message");

            string jsonTraceMessage = RockJsonSerializer.Serialize((object)traceMessage);

            Assert.AreEqual("{\"Level\":\"Verbose\",\"Message\":\"Message\"}", jsonTraceMessage);
        }
Beispiel #2
0
        /// <summary>
        /// Reload the configuration of RockEngine.
        /// Warning: not thread safe.
        /// </summary>
        public void Reload()
        {
            var configurationString = File.ReadAllText(RockEngineConstants.ConfigurationFilePath);

            this.configuration = RockJsonSerializer.Deserialize <RockConfiguration>(configurationString);
            this.tracer        = new RockTracer(this.configuration);
            this.bot           = new RockEngineBot(this.configuration, this.tracer);
            this.pegasus       = RockPegasusFactory.CreatePegasus(this.tracer);
            this.actionId      = 0;
            this.sessionId     = Guid.NewGuid().ToString();
        }
Beispiel #3
0
 public void TestMethodForSerializeRockScene()
 {
     var rockScene = GenerateRockScene();
     var x         = RockJsonSerializer.Serialize(rockScene);
 }
Beispiel #4
0
 public void TestRockJsonSerializerForNull()
 {
     List <int> jsonTraceMessage = RockJsonSerializer.Deserialize <List <int> >("null");
 }