Exemplo n.º 1
0
            private static void OutputHypermediaPathCollection(DocumentPathContextTests parent, IEnumerable <IHypermediaPath> hypermediaPathCollection)
            {
                if (hypermediaPathCollection == null)
                {
                    return;
                }

                foreach (var hypermediaPath in hypermediaPathCollection)
                {
                    var hypermediaPathType     = hypermediaPath.GetType();
                    var hypermediaPathTypeName = hypermediaPathType.Name;

                    var clrResourceTypeName = hypermediaPath.HasClrResourceType() ? hypermediaPath.GetClrResourceType().Name : "null";
                    var path = hypermediaPath.PathSegments.Any()
                        ? hypermediaPath.PathSegments.Aggregate((current, next) => current + "/" + next)
                        : String.Empty;

                    var resourceTypePathTextLine = "    {0, -40} {1, -24} {2, -24}".FormatWith(hypermediaPathTypeName, clrResourceTypeName, path);
                    parent.Output.WriteLine(resourceTypePathTextLine);
                }
            }
Exemplo n.º 2
0
            public void OutputTest(DocumentPathContextTests parent)
            {
                // URL
                parent.Output.WriteLine(this.UrlString);
                parent.Output.WriteLine(String.Empty);

                // Expected CLR Resource Types
                parent.Output.WriteLine("Expected CLR Resource Types");
                foreach (var clrResourceTypeTextLine in this.ExpectedClrResourceTypes.Select(clrResourceType => "    {0, -40}".FormatWith(clrResourceType.Name)))
                {
                    parent.Output.WriteLine(clrResourceTypeTextLine);
                }

                // Blank Line
                parent.Output.WriteLine(String.Empty);

                // Expected Paths
                parent.Output.WriteLine("Expected Document Self Path");
                OutputHypermediaPathCollection(parent, this.ExpectedDocumentSelfPath);

                // Blank Line
                parent.Output.WriteLine(String.Empty);

                // Expected CLR Resource Types
                parent.Output.WriteLine("Actual CLR Resource Types");
                foreach (var clrResourceTypeTextLine in this.ActualClrResourceTypes.Select(clrResourceType => "    {0, -40}".FormatWith(clrResourceType.Name)))
                {
                    parent.Output.WriteLine(clrResourceTypeTextLine);
                }

                // Blank Line
                parent.Output.WriteLine(String.Empty);

                // Actual Paths
                parent.Output.WriteLine("Actual Document Self Path");
                OutputHypermediaPathCollection(parent, this.ActualDocumentSelfPath);
            }