Ejemplo n.º 1
0
        /// <summary>
        /// Create a new array of <see cref="MockTaskItem"/> from an array of dictionary strings.
        /// </summary>
        /// <param name="propName"></param>
        /// <param name="args"></param>
        /// <returns></returns>
        public static MockTaskItem[] FromDictString(string propName, params string[] args)
        {
            List <MockTaskItem> items = new List <MockTaskItem>();
            var dict = ParseUtil.ParseDictString(args, propName);

            if (dict == null)
            {
                return(null);
            }
            foreach (var pair in dict)
            {
                items.Add(new MockTaskItem(pair.Key, pair.Value));
            }
            return(items.ToArray());
        }
Ejemplo n.º 2
0
        public void SimpleJSONTest()
        {
            Directory.CreateDirectory(OutputPath);
            string        targetPath = Path.Combine(OutputPath, nameof(SimpleJSONTest) + ".json");
            BsipaManifest manifest   = new BsipaManifest()
            {
                Id          = "TestPlugin",
                Name        = "Test Plugin",
                Author      = "Zingabopp",
                Version     = "1.0.0",
                GameVersion = "1.14.0",
                Description = "Description of a test plugin."
            };

            manifest.DependsOn = ParseUtil.ParseDictString(new string[] { "TestDepend1|^2.0.1;TestDepend2|^1.0.0" }, "DependsOn");
            manifest.Validate(false);
            File.WriteAllText(targetPath, manifest.ToJson());
        }