JsonMockWrapper.cs 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. #region Header
  2. /**
  3. * JsonMockWrapper.cs
  4. * Mock object implementing IJsonWrapper, to facilitate actions like
  5. * skipping data more efficiently.
  6. *
  7. * The authors disclaim copyright to this source code. For more details, see
  8. * the COPYING file included with this distribution.
  9. **/
  10. #endregion
  11. using System;
  12. using System.Collections;
  13. using System.Collections.Specialized;
  14. namespace LitJson
  15. {
  16. public class JsonMockWrapper : IJsonWrapper
  17. {
  18. public bool IsArray { get { return false; } }
  19. public bool IsBoolean { get { return false; } }
  20. public bool IsDouble { get { return false; } }
  21. public bool IsInt { get { return false; } }
  22. public bool IsLong { get { return false; } }
  23. public bool IsObject { get { return false; } }
  24. public bool IsString { get { return false; } }
  25. public bool GetBoolean () { return false; }
  26. public double GetDouble () { return 0.0; }
  27. public int GetInt () { return 0; }
  28. public JsonType GetJsonType () { return JsonType.None; }
  29. public long GetLong () { return 0L; }
  30. public string GetString () { return ""; }
  31. public void SetBoolean (bool val) {}
  32. public void SetDouble (double val) {}
  33. public void SetInt (int val) {}
  34. public void SetJsonType (JsonType type) {}
  35. public void SetLong (long val) {}
  36. public void SetString (string val) {}
  37. public string ToJson () { return ""; }
  38. public void ToJson (JsonWriter writer) {}
  39. bool IList.IsFixedSize { get { return true; } }
  40. bool IList.IsReadOnly { get { return true; } }
  41. object IList.this[int index] {
  42. get { return null; }
  43. set {}
  44. }
  45. int IList.Add (object value) { return 0; }
  46. void IList.Clear () {}
  47. bool IList.Contains (object value) { return false; }
  48. int IList.IndexOf (object value) { return -1; }
  49. void IList.Insert (int i, object v) {}
  50. void IList.Remove (object value) {}
  51. void IList.RemoveAt (int index) {}
  52. int ICollection.Count { get { return 0; } }
  53. bool ICollection.IsSynchronized { get { return false; } }
  54. object ICollection.SyncRoot { get { return null; } }
  55. void ICollection.CopyTo (Array array, int index) {}
  56. IEnumerator IEnumerable.GetEnumerator () { return null; }
  57. bool IDictionary.IsFixedSize { get { return true; } }
  58. bool IDictionary.IsReadOnly { get { return true; } }
  59. ICollection IDictionary.Keys { get { return null; } }
  60. ICollection IDictionary.Values { get { return null; } }
  61. object IDictionary.this[object key] {
  62. get { return null; }
  63. set {}
  64. }
  65. void IDictionary.Add (object k, object v) {}
  66. void IDictionary.Clear () {}
  67. bool IDictionary.Contains (object key) { return false; }
  68. void IDictionary.Remove (object key) {}
  69. IDictionaryEnumerator IDictionary.GetEnumerator () { return null; }
  70. object IOrderedDictionary.this[int idx] {
  71. get { return null; }
  72. set {}
  73. }
  74. IDictionaryEnumerator IOrderedDictionary.GetEnumerator () {
  75. return null;
  76. }
  77. void IOrderedDictionary.Insert (int i, object k, object v) {}
  78. void IOrderedDictionary.RemoveAt (int i) {}
  79. }
  80. }