Beispiel #1
0
        //-------------------------------------------------------------------------------
        //-------------------------------------------------------------------------------
        private void AnnounceTestFailure(XbrlConformanceTestVariation CurrentVariation, XbrlDocument xbrlDoc)
        {
            var failMessage = new StringBuilder();

            failMessage.AppendFormat("{0}Instance: {1}{2}", Environment.NewLine, CurrentVariation.Instance, Environment.NewLine);
            failMessage.AppendFormat("Name: {0}{1}", CurrentVariation.Name, Environment.NewLine);
            failMessage.AppendFormat("Description: {0}", CurrentVariation.Description);
            if (xbrlDoc != null)
            {
                foreach (var currentValidationError in xbrlDoc.ValidationErrors)
                {
                    failMessage.AppendFormat("{0}{1}Validation Error Type: {2}{3}", Environment.NewLine, Environment.NewLine, currentValidationError.GetType().ToString(), Environment.NewLine);
                    failMessage.AppendFormat("Validation Error Description: {0}{1}", currentValidationError.Message, Environment.NewLine);
                }
            }
            Debug.WriteLine("***");
            Debug.Write("*** FAIL *** [");
            if (CurrentVariation.ValidityExpected == true)
            {
                Debug.WriteLine("Gepsio failed a test expected to pass.]");
            }
            else
            {
                Debug.WriteLine("Gepsio passed a test expected to fail.]");
            }
            Debug.WriteLine("***");
            Debug.WriteLine(failMessage.ToString());
            Assert.Fail(failMessage.ToString());
        }
Beispiel #2
0
        //-------------------------------------------------------------------------------
        //-------------------------------------------------------------------------------
        private void ExecuteVariation(string TestcaseXmlSourceDirectory, XmlNode VariationNode)
        {
            var currentVariation = new XbrlConformanceTestVariation(VariationNode);

            if (string.IsNullOrEmpty(currentVariation.Instance) == true)
            {
                return;
            }

            Debug.Write(currentVariation.Instance);
            Debug.Write(" [");
            Debug.Write(currentVariation.Description);
            Debug.WriteLine("]");
            var instanceXmlSourceFullPathBuilder = new StringBuilder();

            instanceXmlSourceFullPathBuilder.AppendFormat("{0}{1}{2}", TestcaseXmlSourceDirectory, Path.DirectorySeparatorChar, currentVariation.Instance);
            var instanceXmlSourceFullPath = instanceXmlSourceFullPathBuilder.ToString();

            var newXbrlDocument = new XbrlDocument();

            newXbrlDocument.Load(instanceXmlSourceFullPath);
            if (newXbrlDocument.IsValid == true)
            {
                if (currentVariation.ValidityExpected == false)
                {
                    AnnounceTestFailure(currentVariation);
                }
            }
            if (newXbrlDocument.IsValid == false)
            {
                if (currentVariation.ValidityExpected == true)
                {
                    AnnounceTestFailure(currentVariation, newXbrlDocument);
                }
            }
            thisTestsPassed++;
        }
Beispiel #3
0
 //-------------------------------------------------------------------------------
 //-------------------------------------------------------------------------------
 private void AnnounceTestFailure(XbrlConformanceTestVariation CurrentVariation)
 {
     AnnounceTestFailure(CurrentVariation, null);
 }