예제 #1
0
        public void InstallTest(string name, Stream source)
        {
            var res = Repo.CreateResource(name);
            res.Write(source);

            BatchFileTest bft = new BatchFileTest();

            using(Stream s = res.Read ())
            {
                using(StreamReader rd = new StreamReader(s))
                {
                    while(!rd.EndOfStream)
                    {
                        string line = rd.ReadLine ();
                        if(!line.StartsWith ("REM TESTPARAM"))
                            break;

                        string[] parts = line.Split (' ');
                        string paramName = parts[2];
                        string paramDesc = "";
                        for(int i = 3; i < parts.Length; i++)
                            paramDesc = paramDesc + parts[i] + " ";

                        bft.Parameters[paramName] = paramDesc;
                    }
                }
            }
            bft.Name = name;

            var data = Repo.Load<BatchFileDriverData>();
            data.Tests.Add(bft);
            Repo.Store (data);
        }
예제 #2
0
        public void InstallTest(string name, Stream source)
        {
            var res = Repo.CreateResource(name);

            res.Write(source);

            BatchFileTest bft = new BatchFileTest();

            using (Stream s = res.Read())
            {
                using (StreamReader rd = new StreamReader(s))
                {
                    while (!rd.EndOfStream)
                    {
                        string line = rd.ReadLine();
                        if (!line.StartsWith("REM TESTPARAM"))
                        {
                            break;
                        }

                        string[] parts     = line.Split(' ');
                        string   paramName = parts[2];
                        string   paramDesc = "";
                        for (int i = 3; i < parts.Length; i++)
                        {
                            paramDesc = paramDesc + parts[i] + " ";
                        }

                        bft.Parameters[paramName] = paramDesc;
                    }
                }
            }
            bft.Name = name;

            var data = Repo.Load <BatchFileDriverData>();

            data.Tests.Add(bft);
            Repo.Store(data);
        }