Ejemplo n.º 1
0
        public void ApiExceptionObjectSerializesArray()
        {
            string[] arr = new string[2];
            arr[0] = "hi";
            arr[1] = "there";
            var a = new ApiExceptionObject("nonsense", arr);

            Assert.AreEqual(JObject.Parse("{\"type\":\"nonsense\",\"data\":[\"hi\",\"there\"]}").ToString(), a.ToString(), "mismatch: " + a.ToString());
        }
Ejemplo n.º 2
0
        public void ApiExceptionObjectSerializesBool()
        {
            var a = new ApiExceptionObject("nonsense", true);

            Assert.AreEqual(JObject.Parse("{\"type\":\"nonsense\",\"data\":true}").ToString(), a.ToString(), "mismatch: " + a.ToString());
        }