Exemple #1
0
 public SystemAnalyzer(DumpContext context)
 {
     this.context    = context;
     this.systemInfo = new SDSystemContext();
     using (DataTarget t = this.context.CreateTemporaryDbgEngTarget()) {
         this.debugClient = t.DebuggerInterface;
         this.InitSystemInfo();
     }
 }
        public void SystemContextSerializationTest()
        {
            var analyzer = new SystemAnalyzer(this.context);

            Assert.IsNotNull(analyzer);

            string json = analyzer.SerializeSystemInfoToJSON();
            // deserialize
            SDSystemContext systemInfo = JsonConvert.DeserializeObject <SDSystemContext>(json);

            // serialize again, and then check strings
            string json2 = systemInfo.SerializeToJSON();

            // check if objects are equal, relies on correct equals implementation!
            Assert.AreEqual(analyzer.systemInfo, systemInfo);

            // check json before serializing and after deserializing
            StringAssert.Equals(json, json2);
        }