当前位置: 首页>>代码示例>>C#>>正文


C# IOutputWriter.Write方法代码示例

本文整理汇总了C#中IOutputWriter.Write方法的典型用法代码示例。如果您正苦于以下问题:C# IOutputWriter.Write方法的具体用法?C# IOutputWriter.Write怎么用?C# IOutputWriter.Write使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IOutputWriter的用法示例。


在下文中一共展示了IOutputWriter.Write方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: AppendCallDescription

        private static void AppendCallDescription(string callDescription, IOutputWriter writer)
        {
            writer.WriteLine();
            writer.Write("Assertion failed for the following call:");
            writer.WriteLine();

            using (writer.Indent())
            {
                writer.Write(callDescription);
                writer.WriteLine();
            }
        }
开发者ID:bman61,项目名称:FakeItEasy,代码行数:12,代码来源:FakeAsserter.cs

示例2: AppendExpectation

        private static void AppendExpectation(IEnumerable<IFakeObjectCall> calls, string repeatDescription, int matchedCallCount, IOutputWriter writer)
        {
            writer.Write("Expected to find it {0} ", repeatDescription);

            if (calls.Any())
            {
                writer.Write("but found it #{0} times among the calls:", matchedCallCount);
            }
            else
            {
                writer.Write("but no calls were made to the fake object.");
            }

            writer.WriteLine();
        }
开发者ID:bman61,项目名称:FakeItEasy,代码行数:15,代码来源:FakeAsserter.cs

示例3: AppendExpectation

        private void AppendExpectation(string repeatDescription, int repeat, IOutputWriter writer)
        {
            writer.Write("Expected to find it {0} ", repeatDescription);

            if (this.Calls.Any())
            {
                writer.Write("but found it #{0} times among the calls:", repeat);
            }
            else
            {
                writer.Write("but no calls were made to the fake object.");
            }

            writer.WriteLine();
        }
开发者ID:rajeshpillai,项目名称:FakeItEasy,代码行数:15,代码来源:FakeAsserter.cs

示例4: WriteCalls

        private static void WriteCalls(IEnumerable<CallInfo> callInfos, IOutputWriter writer)
        {
            var lastCall = callInfos.Last();
            var numberOfDigitsInLastCallNumber = lastCall.NumberOfDigitsInCallNumber();
            
            foreach (var call in callInfos)
            {
                if (call.CallNumber > 1)
                {
                    writer.WriteLine();
                }

                writer.Write(call.CallNumber);
                writer.Write(": ");

                WriteSpaces(writer, numberOfDigitsInLastCallNumber - call.NumberOfDigitsInCallNumber());

                using (writer.Indent())
                {
                    writer.Write(call.StringRepresentation);
                }
                
                if (call.Repeat > 1)
                {
                    writer.Write(" repeated ");
                    writer.Write(call.Repeat);
                    writer.Write(" times");
                    writer.WriteLine();
                    writer.Write("...");
                }
            }
        }
开发者ID:NameOfTheDragon,项目名称:FakeItEasy,代码行数:32,代码来源:CallWriter.cs

示例5: WriteDescription

        public void WriteDescription(IOutputWriter writer)
        {
            writer.Write("[");

            bool first = true;

            foreach (var constraint in this.Constraints)
            {
                if (!first)
                {
                    writer.Write(", ");
                }
                else
                {
                    first = false;
                }

                constraint.WriteDescription(writer);
            }

            writer.Write("]");
        }
开发者ID:bman61,项目名称:FakeItEasy,代码行数:22,代码来源:AggregateArgumentConstraint.cs

示例6: Render

        public void Render(object result, IEndpoint endpoint, IOutputWriter outputWriter)
        {
            var viewEngineResult = viewEngineCollection.FindView(endpoint);

            if (viewEngineResult == null) return;

            var viewBuilder = new StringBuilder();
            var writer = new StringWriter(viewBuilder);
            viewEngineResult.View.Render(new ViewContext(result), writer);

            outputWriter.Write(viewBuilder.ToString());
            outputWriter.WriteContentType(viewEngineResult.View.ContentType);
        }
开发者ID:UStack,项目名称:UWeb,代码行数:13,代码来源:RenderView.cs

示例7: WriteSpaces

 private static void WriteSpaces(IOutputWriter writer, int numberOfSpaces)
 {
     for (var i = 0; i < numberOfSpaces; i++)
     {
         writer.Write(" ");
     }
 }
开发者ID:NameOfTheDragon,项目名称:FakeItEasy,代码行数:7,代码来源:CallWriter.cs

示例8: WriteDescriptionOfValidCall

        /// <summary>
        /// Writes a description of calls the rule is applicable to.
        /// </summary>
        /// <param name="writer">The writer to write the description to.</param>
        public void WriteDescriptionOfValidCall(IOutputWriter writer)
        {
            writer.Write(this.DescriptionOfValidCall);

            Func<string> wherePrefix = () =>
            {
                wherePrefix = () => "and";
                return "where";
            };

            using (writer.Indent())
            {
                foreach (var wherePredicateDescriptionWriter in this.wherePredicates.Select(x => x.Item2))
                {
                    writer.WriteLine();
                    writer.Write(wherePrefix.Invoke());
                    writer.Write(" ");
                    wherePredicateDescriptionWriter.Invoke(writer);
                }
            }
        }
开发者ID:bverburg,项目名称:FakeItEasy,代码行数:25,代码来源:BuildableCallRule.cs

示例9: WriteDescription

 public void WriteDescription(IOutputWriter writer)
 {
     writer.Write(this.ConstraintDescription);
 }
开发者ID:bman61,项目名称:FakeItEasy,代码行数:4,代码来源:EqualityArgumentConstraint.cs

示例10: Render

 public void Render(object result, IEndpoint endpoint, IOutputWriter outputWriter)
 {
     outputWriter.Write(result.ToString());
     outputWriter.WriteContentType(ContentType.Text);
 }
开发者ID:UStack,项目名称:UWeb,代码行数:5,代码来源:RenderString.cs

示例11: WriteDescription

 public void WriteDescription(IOutputWriter writer)
 {
     writer.Write(this.ToString());
 }
开发者ID:bluePlayer,项目名称:FakeItEasy,代码行数:4,代码来源:ExpressionCallMatcher.cs

示例12: WriteDescription

 public void WriteDescription(IOutputWriter writer)
 {
     writer.Write("<out parameter>");
 }
开发者ID:huoxudong125,项目名称:FakeItEasy,代码行数:4,代码来源:OutArgumentConstraint.cs

示例13: Write

 public void Write(IOutputWriter writer, string mimeType)
 {
     writer.Write(_options.Mimetype, _document.OuterXml);
 }
开发者ID:ahjohannessen,项目名称:FubuMVC.Media,代码行数:4,代码来源:XmlMediaDocument.cs

示例14: WriteLineOf

 private static void WriteLineOf(IOutputWriter outputWriter, string value, int times)
 {
     for (int i = 0; i < times; i++)
         outputWriter.Write(value);
     outputWriter.Write("\n");
 }
开发者ID:neoaisac,项目名称:PrimeTable,代码行数:6,代码来源:PrimeNumbersAppController.cs

示例15: WriteLineTo

		/// <summary>
		/// Writes text followed by a newline
		/// </summary>
		/// <param name="obj">Object</param>
		/// <param name="output">Output</param>
		public static void WriteLineTo(this IOutputWritable obj, IOutputWriter output) {
			obj.WriteTo(output);
			output.Write(Environment.NewLine, BoxedTextColor.ReplScriptOutputText);
		}
开发者ID:manojdjoshi,项目名称:dnSpy,代码行数:9,代码来源:IOutputWritable.cs


注:本文中的IOutputWriter.Write方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。