Exemplo n.º 1
0
        private DatasetElement FindDataset(string datasetName, XElement xml)
        {
            var dataset = DbSafeManagerHelper.FindChild(xml, FileDefinitionHelper.ElementNameDatasets, datasetName);

            if (dataset != null)
            {
                return(DatasetElement.Load(dataset));
            }

            return(null);
        }
Exemplo n.º 2
0
        private ScriptElement FindScript(string scriptName, string filename, XElement xml)
        {
            var script = DbSafeManagerHelper.FindChild(xml, FileDefinitionHelper.ElementNameSripts, scriptName);

            if (script != null)
            {
                return(ScriptElement.Load(script, filename));
            }

            return(null);
        }
Exemplo n.º 3
0
        public void AssertDatasetVsScript(string expectedDatasetName, string actualScriptName, bool sorted, string key, params string[] otherKeys)
        {
            ValidateDependencies();

            DatasetElement expectedData     = FindDataset(expectedDatasetName);
            ScriptElement  actualDataScript = FindScript(actualScriptName);
            DatasetElement actualData       = DatabaseClient.ReadTable(actualDataScript.Value, _formatterManager);

            string[] keys = new string[] { key };
            if (otherKeys != null)
            {
                keys = keys.Union(otherKeys).ToArray();
            }

            DbSafeManagerHelper.CompareDatasets(expectedData, actualData, keys, sorted, false);
        }