Exemple #1
0
        private void AfterTransformation(IProjectTransformationResult result, string fileName)
        {
            AssertValidAnnotations(result);
            Assert.AreEqual(1, result.Documents.Count);
            var document = result.Documents[0];

            Assert.NotNull(document.OriginalModified);
            Assert.AreEqual(GetOutputFile(fileName), document.Transformed.ToFullString());
        }
Exemple #2
0
        private void AfterCatchPropertyTransfromation(IProjectTransformationResult result)
        {
            AssertValidAnnotations(result);
            Assert.AreEqual(1, result.Documents.Count);
            var document = result.Documents[0];

            Assert.NotNull(document.OriginalModified);
            Assert.AreEqual(GetOutputFile(nameof(CatchProperty)), document.Transformed.ToFullString());
        }
Exemple #3
0
        private void AfterPropagateOperationCanceledExceptionTransfromation(IProjectTransformationResult result, string fileName)
        {
            AssertValidAnnotations(result);
            Assert.AreEqual(1, result.Documents.Count);
            var document = result.Documents[0];

            Assert.NotNull(document.OriginalModified);
            Console.WriteLine(document.Transformed.ToFullString());
            Assert.AreEqual(GetOutputFile(fileName), document.Transformed.ToFullString());
        }
Exemple #4
0
 public void AssertValidAnnotations(IProjectTransformationResult projectResult)
 {
     foreach (var documentResult in projectResult.Documents)
     {
         var rootNode = documentResult.Transformed;
         Assert.AreEqual(1, rootNode.GetAnnotatedNodes(documentResult.Annotation).ToList().Count);
         foreach (var namespaceResult in documentResult.TransformedNamespaces)
         {
             Assert.AreEqual(1, rootNode.GetAnnotatedNodes(namespaceResult.Annotation).ToList().Count);
             foreach (var typeResult in namespaceResult.TransformedTypes)
             {
                 Assert.AreEqual(1, rootNode.GetAnnotatedNodes(typeResult.Annotation).ToList().Count);
                 foreach (var methodResult in typeResult.TransformedMethods)
                 {
                     Assert.AreEqual(1, rootNode.GetAnnotatedNodes(methodResult.Annotation).ToList().Count);
                 }
             }
         }
         foreach (var typeResult in documentResult.TransformedTypes)
         {
             Assert.AreEqual(1, rootNode.GetAnnotatedNodes(typeResult.Annotation).ToList().Count);
         }
     }
 }
Exemple #5
0
 private void VoidAfterTransformation(IProjectTransformationResult result)
 {
     AfterTransformation(result, nameof(TestCase) + "Void");
 }