public void WorkflowHelperSerializeWorkflowWithModelServiceExpectedReturnsActivityXaml() { var modelService = CreateModelService(); var result = new WorkflowHelper().SerializeWorkflow(modelService.Object).ToString(); Assert.IsFalse(result.Contains("<?xml version=\"1.0\" encoding=\"utf-16\"?>")); var root = XElement.Parse(result); XNamespace sads = "http://schemas.microsoft.com/netfx/2010/xaml/activities/debugger"; var debugSymbol = root.Element(sads + "DebugSymbol.Symbol"); if (debugSymbol != null) { Assert.IsTrue(string.IsNullOrEmpty(debugSymbol.Value)); } XNamespace mva = "clr-namespace:Microsoft.VisualBasic.Activities;assembly=System.Activities"; var vbSettings = root.Element(mva + "VisualBasic.Settings"); Assert.IsNotNull(vbSettings); XNamespace a = "http://schemas.microsoft.com/netfx/2009/xaml/activities"; XNamespace x = "http://schemas.microsoft.com/winfx/2006/xaml"; var namespacesForImplementation = root.Element(a + "TextExpression.NamespacesForImplementation"); Assert.IsNotNull(namespacesForImplementation); XNamespace scg = "clr-namespace:System.Collections.Generic;assembly=mscorlib"; var nsList = namespacesForImplementation.Element(scg + "List"); Assert.IsNotNull(nsList); var actualNamespaces = nsList.Elements(x + "String").Select(e => e.Value).ToList(); Assert.IsTrue(ExpectedNamespaces.SequenceEqual(actualNamespaces)); var referencesForImplementation = root.Element(a + "TextExpression.ReferencesForImplementation"); Assert.IsNotNull(referencesForImplementation); XNamespace sco = "clr-namespace:System.Collections.ObjectModel;assembly=mscorlib"; var asmList = referencesForImplementation.Element(sco + "Collection"); Assert.IsNotNull(asmList); var actualAssemblies = asmList.Elements(a + "AssemblyReference").Select(e => e.Value).ToList(); Assert.IsTrue(ExpectedAssemblies.SequenceEqual(actualAssemblies)); }
public void WorkflowHelperSerializeWorkflowWithModelServiceExpectedReturnsActivityXaml() { var modelService = CreateModelService(); var result = new WorkflowHelper().SerializeWorkflow(modelService.Object).ToString(); Assert.IsFalse(result.Contains("<?xml version=\"1.0\" encoding=\"utf-16\"?>")); var root = XElement.Parse(result); XNamespace sads = "http://schemas.microsoft.com/netfx/2010/xaml/activities/debugger"; var debugSymbol = root.Element(sads + "DebugSymbol.Symbol"); if(debugSymbol != null) { Assert.IsTrue(string.IsNullOrEmpty(debugSymbol.Value)); } XNamespace mva = "clr-namespace:Microsoft.VisualBasic.Activities;assembly=System.Activities"; var vbSettings = root.Element(mva + "VisualBasic.Settings"); Assert.IsNotNull(vbSettings); XNamespace a = "http://schemas.microsoft.com/netfx/2009/xaml/activities"; XNamespace x = "http://schemas.microsoft.com/winfx/2006/xaml"; var namespacesForImplementation = root.Element(a + "TextExpression.NamespacesForImplementation"); Assert.IsNotNull(namespacesForImplementation); XNamespace scg = "clr-namespace:System.Collections.Generic;assembly=mscorlib"; var nsList = namespacesForImplementation.Element(scg + "List"); Assert.IsNotNull(nsList); var actualNamespaces = nsList.Elements(x + "String").Select(e => e.Value).ToList(); Assert.IsTrue(ExpectedNamespaces.SequenceEqual(actualNamespaces)); var referencesForImplementation = root.Element(a + "TextExpression.ReferencesForImplementation"); Assert.IsNotNull(referencesForImplementation); XNamespace sco = "clr-namespace:System.Collections.ObjectModel;assembly=mscorlib"; var asmList = referencesForImplementation.Element(sco + "Collection"); Assert.IsNotNull(asmList); var actualAssemblies = asmList.Elements(a + "AssemblyReference").Select(e => e.Value).ToList(); Assert.IsTrue(ExpectedAssemblies.SequenceEqual(actualAssemblies)); }