Ejemplo n.º 1
0
        public void TestGetJSONReturnsNotNull()
        {
            _json = new JSON();
            var result = _json.getJSON();

            Assert.IsTrue(result != null);
        }
Ejemplo n.º 2
0
 public GroupController(IAccount account, IJSON json, ICSContentType contenttype, ILogging logging)
 {
     this.account     = account;
     this.json        = json;
     this.contenttype = contenttype;
     this.logging     = logging;
 }
Ejemplo n.º 3
0
        public void TestGetJSONReturnsCorrectFormate()
        {
            _json = new JSON();
            var result = _json.getJSON();

            Assert.IsTrue(result is Dictionary <string, dynamic>);
        }
Ejemplo n.º 4
0
 public ConfiguratorController(IJSTree jstree, ITagConfigurator tagConfigurator, IJSON json, IFileWork filework)
 {
     this.jstree          = jstree;
     this.tagConfigurator = tagConfigurator;
     this.json            = json;
     this.filework        = filework;
 }
Ejemplo n.º 5
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="ty"></param>
 /// <param name="i"></param>
 public static void ToJSON(Type ty, IJSON i)
 {
     if (_jsonMap.ContainsKey(ty))
     {
         throw new ArgumentException(string.Format("已经为{0}注册了{1}",
                                                   ty.FullName, _jsonMap[ty].GetType().FullName));
     }
     _jsonMap.Add(ty, i);
 }
Ejemplo n.º 6
0
        public void TestGetJSONReturnsOP()
        {
            _json = new JSON();
            var     result = _json.getJSON();
            dynamic value;

            result.TryGetValue("op", out value);

            Assert.IsTrue(value != null);
        }
Ejemplo n.º 7
0
 /// <summary>
 /// A Response containing the given status, reason and a body from the given json.
 /// </summary>
 public Of(int status, string reason, IJSON body, params IMapInput[] extraParts) : base(() =>
                                                                                        new Response.Of(
                                                                                            new Status(status),
                                                                                            new Reason(reason),
                                                                                            new Body(body),
                                                                                            new Parts.Joined(extraParts)
                                                                                            ),
                                                                                        live: false
                                                                                        )
 {
 }
Ejemplo n.º 8
0
        public IJSON Merge(IJSON json)
        {
            foreach (String key in keys)
            {
                foreach (String foreignKey in json.Keys())
                {
                    if (key.Equals(foreignKey))
                    {
                        throw new Exception("Key already exists!");
                    }
                }
            }

            StringBuilder str = new StringBuilder(json.GetFormatted());

            str.Remove(0, 1).Remove(str.Length - 1, 1);
            if (this.length > 0)
            {
                this.json.Append(", ");
            }
            this.json.Append(str.ToString());
            return(this);
        }
Ejemplo n.º 9
0
 public ReportsController(IReportServer reports, IJSON json)
 {
     this._reports = reports;
     this._json    = json;
 }
Ejemplo n.º 10
0
 public TrendsController(ITrends trends, IJSON json)
 {
     _Trends = trends;
     _json   = json;
 }
Ejemplo n.º 11
0
 public ReportsController(IReportServer reports, IJSON json, IAccount account)
 {
     this.account  = account;
     this._reports = reports;
     this._json    = json;
 }
Ejemplo n.º 12
0
 public ContentTypeController(ICSContentType contenttype, IJSON json, ILogging logging)
 {
     this.contenttype = contenttype;
     this.json        = json;
     this.logging     = logging;
 }
Ejemplo n.º 13
0
 /// <summary>
 /// A 200/OK Response containing the given json.
 /// </summary>
 public Of(IJSON body, params IMapInput[] extraParts) : this(200, "OK", body, extraParts)
 {
 }
Ejemplo n.º 14
0
 public AccountController(IAccount account, IJSON json, ILogging logging)
 {
     this.account = account;
     this.json    = json;
     this.logging = logging;
 }
Ejemplo n.º 15
0
 /// <summary>
 /// Adds a json body to a request. Sets the Content-Type to 'application/json'
 /// </summary>
 public Body(IJSON json) : this(
         new TextOf(() => json.Token().ToString()),
         "application/json"
         )
 {
 }
Ejemplo n.º 16
0
        //public static List<ConfiguratorState> configuratorState = new List<ConfiguratorState>();

        public ConfiguratorController(IJSTree jstree, ITagConfigurator tagConfigurator, IJSON json)
        {
            this.jstree          = jstree;
            this.tagConfigurator = tagConfigurator;
            this.json            = json;
        }