Example #1
0
        public static PairwiseTestMatrix GenerateMatrixFromPictFile(string modelFile, PairwiseSettings settings)
        {
            if (modelFile == null)
            {
                throw new ArgumentNullException("modelFile");
            }
            if (settings == null)
            {
                throw new ArgumentNullException("settings");
            }
            string[][]         results = null;
            PairwiseTestMatrix matrix  = new PairwiseTestMatrix();

            using (PictRunner pr = new PictRunner())
            {
                results = pr.AlwaysExecutePictOnFileName(modelFile, settings);
                matrix.PictExecutionInformation = pr.LastExecutionInformation;
            }

            string[]           headerFields = results[0];
            PairwiseTestCase[] cases        = new PairwiseTestCase[results.Length - 1];

            for (int tupleNo = 0; tupleNo < cases.Length; ++tupleNo)
            {
                string[] fields = results[tupleNo + 1];
                PairwiseTestParameter[] values = new PairwiseTestParameter[fields.Length];

                for (int field = 0; field < fields.Length; ++field)
                {
                    values[field] = new PairwiseTestParameter(headerFields[field], fields[field]);
                }

                cases[tupleNo] = new PairwiseTestCase(values);
            }

            // NOTE: sorting makes things easier to diff, kinda
            Array.Sort(cases, PairwiseTestCase.Comparer);
            matrix.PairwiseTestCases = cases;
            return(matrix);
        }
Example #2
0
        public override bool Equals(object obj)
        {
            PairwiseTestParameter that = obj as PairwiseTestParameter;

            return(that != null && this.name == that.name && this.val == that.val);
        }