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()); }
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()); }
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()); }
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); } } }
private void VoidAfterTransformation(IProjectTransformationResult result) { AfterTransformation(result, nameof(TestCase) + "Void"); }