Skip to content

Commit

Permalink
Reverted changes to AssertionScope to ensure binary compatibility (#977)
Browse files Browse the repository at this point in the history
  • Loading branch information
dennisdoomen committed Nov 20, 2018
1 parent 014cf50 commit 9a36498
Showing 1 changed file with 19 additions and 5 deletions.
24 changes: 19 additions & 5 deletions Src/FluentAssertions/Execution/AssertionScope.cs
Expand Up @@ -78,7 +78,7 @@ public static AssertionScope Current
private set => current = value;
}

public IAssertionScope UsingLineBreaks
public AssertionScope UsingLineBreaks
{
get
{
Expand All @@ -92,7 +92,7 @@ public bool Succeeded
get => succeeded.HasValue && succeeded.Value;
}

public IAssertionScope BecauseOf(string because, params object[] becauseArgs)
public AssertionScope BecauseOf(string because, params object[] becauseArgs)
{
reason = () =>
{
Expand Down Expand Up @@ -125,7 +125,7 @@ public IAssertionScope BecauseOf(string because, params object[] becauseArgs)
/// </remarks>
/// <param name="message">The format string that represents the failure message.</param>
/// <param name="args">Optional arguments to any numbered placeholders.</param>
public IAssertionScope WithExpectation(string message, params object[] args)
public AssertionScope WithExpectation(string message, params object[] args)
{
var localReason = reason;
expectation = () =>
Expand All @@ -152,7 +152,7 @@ public GivenSelector<T> Given<T>(Func<T> selector)
return new GivenSelector<T>(selector, !succeeded.HasValue || succeeded.Value, this);
}

public IAssertionScope ForCondition(bool condition)
public AssertionScope ForCondition(bool condition)
{
succeeded = condition;

Expand Down Expand Up @@ -266,10 +266,24 @@ public void Dispose()
}
}

public IAssertionScope WithDefaultIdentifier(string identifier)
public AssertionScope WithDefaultIdentifier(string identifier)
{
fallbackIdentifier = identifier;
return this;
}

#region Explicit Implementation to support the interface

IAssertionScope IAssertionScope.ForCondition(bool condition) => ForCondition(condition);

IAssertionScope IAssertionScope.BecauseOf(string because, params object[] becauseArgs) => BecauseOf(because, becauseArgs);

IAssertionScope IAssertionScope.WithExpectation(string message, params object[] args) => WithExpectation(message, args);

IAssertionScope IAssertionScope.WithDefaultIdentifier(string identifier) => WithDefaultIdentifier(identifier);

IAssertionScope IAssertionScope.UsingLineBreaks => UsingLineBreaks;

#endregion
}
}

0 comments on commit 9a36498

Please sign in to comment.