private static string DescriptionOf(ISelfDescribing selfDescribing) { TextWriter writer = new DescriptionWriter(); selfDescribing.DescribeTo(writer); return(writer.ToString()); }
private static void WriteExpected(ISelfDescribing matcher, TextWriter writer) { writer.Write(TextMessageWriter.Pfx_Expected); var description = new StringDescription(); matcher.DescribeTo(description); writer.Write(description.ToString()); writer.WriteLine(); }
public static void ShouldHaveDescription(this ISelfDescribing matcher, string expected) { var description = new StringDescription(); matcher.DescribeTo(description); var actual = description.ToString(); Xunit.Assert.Equal(expected, actual); }
public static void ShouldHaveDescription(this ISelfDescribing matcher, IMatcher <string> expectedMatcher) { var description = new StringDescription(); matcher.DescribeTo(description); var actual = description.ToString(); Assert.That(actual, expectedMatcher); }
/// <summary> /// Gets the name of the member to be used as the name for a mock returned an a call to a stub. /// </summary> /// <param name="invocation">The invocation.</param> /// <returns>Name of the mock created as a result value on a call to a stub.</returns> private string GetMemberName(ISelfDescribing invocation) { var writer = new StringWriter(); invocation.DescribeTo(writer); var name = writer.ToString(); return(name.Replace(Environment.NewLine, string.Empty)); }
public IDescription AppendDescriptionOf(ISelfDescribing value) { value.DescribeTo(this); return(this); }
/// <summary> /// Gets the name of the member to be used as the name for a mock returned an a call to a stub. /// </summary> /// <param name="invocation">The invocation.</param> /// <returns>Name of the mock created as a result value on a call to a stub.</returns> private string GetMemberName(ISelfDescribing invocation) { var writer = new StringWriter(); invocation.DescribeTo(writer); var name = writer.ToString(); return name.Replace(Environment.NewLine, string.Empty); }