Skip to content

Commit

Permalink
SAVEPOINT
Browse files Browse the repository at this point in the history
  • Loading branch information
lg2de committed Aug 14, 2022
1 parent ba5a94a commit 25706b2
Show file tree
Hide file tree
Showing 9 changed files with 73 additions and 61 deletions.
15 changes: 2 additions & 13 deletions Src/FluentAssertions/AssertionExtensions.cs
Expand Up @@ -1050,9 +1050,9 @@ public static void Should<TAssertions>(this SimpleTimeSpanAssertions<TAssertions
InvalidShouldCall();
}

/// <inheritdoc cref="Should{T}(System.Threading.Tasks.TaskCompletionSource{T})" />
/// <inheritdoc cref="Should(ExecutionTimeAssertions)" />
[Obsolete("You are asserting the 'AndConstraint' itself. Remove the 'Should()' method directly following 'And'", error: true)]
public static void Should<TSubject>(this TaskCompletionSourceAssertions<TSubject> _)
public static void Should(this TaskCompletionSourceAssertionsBase _)
{
InvalidShouldCall();
}
Expand Down Expand Up @@ -1089,17 +1089,6 @@ public static void Should<TAssertions>(this DateTimeOffsetRangeAssertions<TAsser
InvalidShouldCall();
}

#if NET6_0_OR_GREATER

/// <inheritdoc cref="Should(System.Threading.Tasks.TaskCompletionSource)" />
[Obsolete("You are asserting the 'AndConstraint' itself. Remove the 'Should()' method directly following 'And'", error: true)]
public static void Should(this TaskCompletionSourceAssertions _)
{
InvalidShouldCall();
}

#endif

[DoesNotReturn]
private static void InvalidShouldCall()
{
Expand Down
Expand Up @@ -26,7 +26,7 @@ public TaskCompletionSourceAssertions(TaskCompletionSource tcs, IClock clock)
}

/// <summary>
/// Asserts that the <see cref="Task"/> of the current <see cref="TaskCompletionSource{T}"/> will complete within the specified time.
/// Asserts that the <see cref="Task"/> of the current <see cref="TaskCompletionSource"/> will complete within the specified time.
/// </summary>
/// <param name="timeSpan">The allowed time span for the operation.</param>
/// <param name="because">
Expand Down Expand Up @@ -57,7 +57,7 @@ public TaskCompletionSourceAssertions(TaskCompletionSource tcs, IClock clock)
}

/// <summary>
/// Asserts that the <see cref="Task"/> of the current <see cref="TaskCompletionSource{T}"/> will not complete within the specified time.
/// Asserts that the <see cref="Task"/> of the current <see cref="TaskCompletionSource"/> will not complete within the specified time.
/// </summary>
/// <param name="timeSpan">The time span to wait for the operation.</param>
/// <param name="because">
Expand Down Expand Up @@ -189,7 +189,7 @@ protected TaskCompletionSourceAssertionsBase(IClock clock)
/// <summary>
/// Monitors the specified task whether it completes withing the remaining time span.
/// </summary>
protected async Task<bool> CompletesWithinTimeoutAsync(Task target, TimeSpan remainingTime)
private protected async Task<bool> CompletesWithinTimeoutAsync(Task target, TimeSpan remainingTime)
{
using var timeoutCancellationTokenSource = new CancellationTokenSource();

Expand Down
Expand Up @@ -43,6 +43,9 @@ namespace FluentAssertions
[System.Obsolete("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" +
"ly following \'And\'", true)]
public static void Should(this FluentAssertions.Specialized.ExecutionTimeAssertions _) { }
[System.Obsolete("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" +
"ly following \'And\'", true)]
public static void Should(this FluentAssertions.Specialized.TaskCompletionSourceAssertionsBase _) { }
public static FluentAssertions.Types.MethodInfoSelectorAssertions Should(this FluentAssertions.Types.MethodInfoSelector methodSelector) { }
[System.Obsolete("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" +
"ly following \'And\'", true)]
Expand Down Expand Up @@ -135,9 +138,6 @@ namespace FluentAssertions
"ly following \'And\'", true)]
public static void Should<TAssertions>(this FluentAssertions.Primitives.SimpleTimeSpanAssertions<TAssertions> _)
where TAssertions : FluentAssertions.Primitives.SimpleTimeSpanAssertions<TAssertions> { }
[System.Obsolete("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" +
"ly following \'And\'", true)]
public static void Should<TSubject>(this FluentAssertions.Specialized.TaskCompletionSourceAssertions<TSubject> _) { }
public static FluentAssertions.Collections.GenericCollectionAssertions<T> Should<T>(this System.Collections.Generic.IEnumerable<T> actualValue) { }
public static FluentAssertions.Specialized.GenericAsyncFunctionAssertions<T> Should<T>(this System.Func<System.Threading.Tasks.Task<T>> action) { }
public static FluentAssertions.Specialized.FunctionAssertions<T> Should<T>(this System.Func<T> func) { }
Expand Down Expand Up @@ -2348,13 +2348,17 @@ namespace FluentAssertions.Specialized
public NonGenericAsyncFunctionAssertions(System.Func<System.Threading.Tasks.Task> subject, FluentAssertions.Specialized.IExtractExceptions extractor) { }
public NonGenericAsyncFunctionAssertions(System.Func<System.Threading.Tasks.Task> subject, FluentAssertions.Specialized.IExtractExceptions extractor, FluentAssertions.Common.IClock clock) { }
}
public class TaskCompletionSourceAssertions<T>
public class TaskCompletionSourceAssertionsBase
{
protected TaskCompletionSourceAssertionsBase(FluentAssertions.Common.IClock clock) { }
public override bool Equals(object obj) { }
}
public class TaskCompletionSourceAssertions<T> : FluentAssertions.Specialized.TaskCompletionSourceAssertionsBase
{
public TaskCompletionSourceAssertions(System.Threading.Tasks.TaskCompletionSource<T> tcs) { }
public TaskCompletionSourceAssertions(System.Threading.Tasks.TaskCompletionSource<T> tcs, FluentAssertions.Common.IClock clock) { }
public System.Threading.Tasks.Task<FluentAssertions.AndWhichConstraint<FluentAssertions.Specialized.TaskCompletionSourceAssertions<T>, T>> CompleteWithinAsync(System.TimeSpan timeSpan, string because = "", params object[] becauseArgs) { }
public override bool Equals(object obj) { }
public System.Threading.Tasks.Task NotCompleteWithinAsync(System.TimeSpan timeSpan, string because = "", params object[] becauseArgs) { }
public System.Threading.Tasks.Task<FluentAssertions.AndConstraint<FluentAssertions.Specialized.TaskCompletionSourceAssertions<T>>> NotCompleteWithinAsync(System.TimeSpan timeSpan, string because = "", params object[] becauseArgs) { }
}
}
namespace FluentAssertions.Streams
Expand Down
Expand Up @@ -43,6 +43,9 @@ namespace FluentAssertions
[System.Obsolete("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" +
"ly following \'And\'", true)]
public static void Should(this FluentAssertions.Specialized.ExecutionTimeAssertions _) { }
[System.Obsolete("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" +
"ly following \'And\'", true)]
public static void Should(this FluentAssertions.Specialized.TaskCompletionSourceAssertionsBase _) { }
public static FluentAssertions.Types.MethodInfoSelectorAssertions Should(this FluentAssertions.Types.MethodInfoSelector methodSelector) { }
[System.Obsolete("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" +
"ly following \'And\'", true)]
Expand Down Expand Up @@ -148,9 +151,6 @@ namespace FluentAssertions
"ly following \'And\'", true)]
public static void Should<TAssertions>(this FluentAssertions.Primitives.TimeOnlyAssertions<TAssertions> _)
where TAssertions : FluentAssertions.Primitives.TimeOnlyAssertions<TAssertions> { }
[System.Obsolete("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" +
"ly following \'And\'", true)]
public static void Should<TSubject>(this FluentAssertions.Specialized.TaskCompletionSourceAssertions<TSubject> _) { }
public static FluentAssertions.Collections.GenericCollectionAssertions<T> Should<T>(this System.Collections.Generic.IEnumerable<T> actualValue) { }
public static FluentAssertions.Specialized.GenericAsyncFunctionAssertions<T> Should<T>(this System.Func<System.Threading.Tasks.Task<T>> action) { }
public static FluentAssertions.Specialized.FunctionAssertions<T> Should<T>(this System.Func<T> func) { }
Expand Down Expand Up @@ -2467,21 +2467,24 @@ namespace FluentAssertions.Specialized
public NonGenericAsyncFunctionAssertions(System.Func<System.Threading.Tasks.Task> subject, FluentAssertions.Specialized.IExtractExceptions extractor) { }
public NonGenericAsyncFunctionAssertions(System.Func<System.Threading.Tasks.Task> subject, FluentAssertions.Specialized.IExtractExceptions extractor, FluentAssertions.Common.IClock clock) { }
}
public class TaskCompletionSourceAssertions
public class TaskCompletionSourceAssertions : FluentAssertions.Specialized.TaskCompletionSourceAssertionsBase
{
public TaskCompletionSourceAssertions(System.Threading.Tasks.TaskCompletionSource tcs) { }
public TaskCompletionSourceAssertions(System.Threading.Tasks.TaskCompletionSource tcs, FluentAssertions.Common.IClock clock) { }
public System.Threading.Tasks.Task CompleteWithinAsync(System.TimeSpan timeSpan, string because = "", params object[] becauseArgs) { }
public System.Threading.Tasks.Task<FluentAssertions.AndConstraint<FluentAssertions.Specialized.TaskCompletionSourceAssertions>> CompleteWithinAsync(System.TimeSpan timeSpan, string because = "", params object[] becauseArgs) { }
public System.Threading.Tasks.Task<FluentAssertions.AndConstraint<FluentAssertions.Specialized.TaskCompletionSourceAssertions>> NotCompleteWithinAsync(System.TimeSpan timeSpan, string because = "", params object[] becauseArgs) { }
}
public class TaskCompletionSourceAssertionsBase
{
protected TaskCompletionSourceAssertionsBase(FluentAssertions.Common.IClock clock) { }
public override bool Equals(object obj) { }
public System.Threading.Tasks.Task NotCompleteWithinAsync(System.TimeSpan timeSpan, string because = "", params object[] becauseArgs) { }
}
public class TaskCompletionSourceAssertions<T>
public class TaskCompletionSourceAssertions<T> : FluentAssertions.Specialized.TaskCompletionSourceAssertionsBase
{
public TaskCompletionSourceAssertions(System.Threading.Tasks.TaskCompletionSource<T> tcs) { }
public TaskCompletionSourceAssertions(System.Threading.Tasks.TaskCompletionSource<T> tcs, FluentAssertions.Common.IClock clock) { }
public System.Threading.Tasks.Task<FluentAssertions.AndWhichConstraint<FluentAssertions.Specialized.TaskCompletionSourceAssertions<T>, T>> CompleteWithinAsync(System.TimeSpan timeSpan, string because = "", params object[] becauseArgs) { }
public override bool Equals(object obj) { }
public System.Threading.Tasks.Task NotCompleteWithinAsync(System.TimeSpan timeSpan, string because = "", params object[] becauseArgs) { }
public System.Threading.Tasks.Task<FluentAssertions.AndConstraint<FluentAssertions.Specialized.TaskCompletionSourceAssertions<T>>> NotCompleteWithinAsync(System.TimeSpan timeSpan, string because = "", params object[] becauseArgs) { }
}
}
namespace FluentAssertions.Streams
Expand Down
Expand Up @@ -43,6 +43,9 @@ namespace FluentAssertions
[System.Obsolete("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" +
"ly following \'And\'", true)]
public static void Should(this FluentAssertions.Specialized.ExecutionTimeAssertions _) { }
[System.Obsolete("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" +
"ly following \'And\'", true)]
public static void Should(this FluentAssertions.Specialized.TaskCompletionSourceAssertionsBase _) { }
public static FluentAssertions.Types.MethodInfoSelectorAssertions Should(this FluentAssertions.Types.MethodInfoSelector methodSelector) { }
[System.Obsolete("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" +
"ly following \'And\'", true)]
Expand Down Expand Up @@ -135,9 +138,6 @@ namespace FluentAssertions
"ly following \'And\'", true)]
public static void Should<TAssertions>(this FluentAssertions.Primitives.SimpleTimeSpanAssertions<TAssertions> _)
where TAssertions : FluentAssertions.Primitives.SimpleTimeSpanAssertions<TAssertions> { }
[System.Obsolete("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" +
"ly following \'And\'", true)]
public static void Should<TSubject>(this FluentAssertions.Specialized.TaskCompletionSourceAssertions<TSubject> _) { }
public static FluentAssertions.Collections.GenericCollectionAssertions<T> Should<T>(this System.Collections.Generic.IEnumerable<T> actualValue) { }
public static FluentAssertions.Specialized.GenericAsyncFunctionAssertions<T> Should<T>(this System.Func<System.Threading.Tasks.Task<T>> action) { }
public static FluentAssertions.Specialized.FunctionAssertions<T> Should<T>(this System.Func<T> func) { }
Expand Down Expand Up @@ -2348,13 +2348,17 @@ namespace FluentAssertions.Specialized
public NonGenericAsyncFunctionAssertions(System.Func<System.Threading.Tasks.Task> subject, FluentAssertions.Specialized.IExtractExceptions extractor) { }
public NonGenericAsyncFunctionAssertions(System.Func<System.Threading.Tasks.Task> subject, FluentAssertions.Specialized.IExtractExceptions extractor, FluentAssertions.Common.IClock clock) { }
}
public class TaskCompletionSourceAssertions<T>
public class TaskCompletionSourceAssertionsBase
{
protected TaskCompletionSourceAssertionsBase(FluentAssertions.Common.IClock clock) { }
public override bool Equals(object obj) { }
}
public class TaskCompletionSourceAssertions<T> : FluentAssertions.Specialized.TaskCompletionSourceAssertionsBase
{
public TaskCompletionSourceAssertions(System.Threading.Tasks.TaskCompletionSource<T> tcs) { }
public TaskCompletionSourceAssertions(System.Threading.Tasks.TaskCompletionSource<T> tcs, FluentAssertions.Common.IClock clock) { }
public System.Threading.Tasks.Task<FluentAssertions.AndWhichConstraint<FluentAssertions.Specialized.TaskCompletionSourceAssertions<T>, T>> CompleteWithinAsync(System.TimeSpan timeSpan, string because = "", params object[] becauseArgs) { }
public override bool Equals(object obj) { }
public System.Threading.Tasks.Task NotCompleteWithinAsync(System.TimeSpan timeSpan, string because = "", params object[] becauseArgs) { }
public System.Threading.Tasks.Task<FluentAssertions.AndConstraint<FluentAssertions.Specialized.TaskCompletionSourceAssertions<T>>> NotCompleteWithinAsync(System.TimeSpan timeSpan, string because = "", params object[] becauseArgs) { }
}
}
namespace FluentAssertions.Streams
Expand Down
Expand Up @@ -43,6 +43,9 @@ namespace FluentAssertions
[System.Obsolete("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" +
"ly following \'And\'", true)]
public static void Should(this FluentAssertions.Specialized.ExecutionTimeAssertions _) { }
[System.Obsolete("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" +
"ly following \'And\'", true)]
public static void Should(this FluentAssertions.Specialized.TaskCompletionSourceAssertionsBase _) { }
public static FluentAssertions.Types.MethodInfoSelectorAssertions Should(this FluentAssertions.Types.MethodInfoSelector methodSelector) { }
[System.Obsolete("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" +
"ly following \'And\'", true)]
Expand Down Expand Up @@ -135,9 +138,6 @@ namespace FluentAssertions
"ly following \'And\'", true)]
public static void Should<TAssertions>(this FluentAssertions.Primitives.SimpleTimeSpanAssertions<TAssertions> _)
where TAssertions : FluentAssertions.Primitives.SimpleTimeSpanAssertions<TAssertions> { }
[System.Obsolete("You are asserting the \'AndConstraint\' itself. Remove the \'Should()\' method direct" +
"ly following \'And\'", true)]
public static void Should<TSubject>(this FluentAssertions.Specialized.TaskCompletionSourceAssertions<TSubject> _) { }
public static FluentAssertions.Collections.GenericCollectionAssertions<T> Should<T>(this System.Collections.Generic.IEnumerable<T> actualValue) { }
public static FluentAssertions.Specialized.GenericAsyncFunctionAssertions<T> Should<T>(this System.Func<System.Threading.Tasks.Task<T>> action) { }
public static FluentAssertions.Specialized.FunctionAssertions<T> Should<T>(this System.Func<T> func) { }
Expand Down Expand Up @@ -2348,13 +2348,17 @@ namespace FluentAssertions.Specialized
public NonGenericAsyncFunctionAssertions(System.Func<System.Threading.Tasks.Task> subject, FluentAssertions.Specialized.IExtractExceptions extractor) { }
public NonGenericAsyncFunctionAssertions(System.Func<System.Threading.Tasks.Task> subject, FluentAssertions.Specialized.IExtractExceptions extractor, FluentAssertions.Common.IClock clock) { }
}
public class TaskCompletionSourceAssertions<T>
public class TaskCompletionSourceAssertionsBase
{
protected TaskCompletionSourceAssertionsBase(FluentAssertions.Common.IClock clock) { }
public override bool Equals(object obj) { }
}
public class TaskCompletionSourceAssertions<T> : FluentAssertions.Specialized.TaskCompletionSourceAssertionsBase
{
public TaskCompletionSourceAssertions(System.Threading.Tasks.TaskCompletionSource<T> tcs) { }
public TaskCompletionSourceAssertions(System.Threading.Tasks.TaskCompletionSource<T> tcs, FluentAssertions.Common.IClock clock) { }
public System.Threading.Tasks.Task<FluentAssertions.AndWhichConstraint<FluentAssertions.Specialized.TaskCompletionSourceAssertions<T>, T>> CompleteWithinAsync(System.TimeSpan timeSpan, string because = "", params object[] becauseArgs) { }
public override bool Equals(object obj) { }
public System.Threading.Tasks.Task NotCompleteWithinAsync(System.TimeSpan timeSpan, string because = "", params object[] becauseArgs) { }
public System.Threading.Tasks.Task<FluentAssertions.AndConstraint<FluentAssertions.Specialized.TaskCompletionSourceAssertions<T>>> NotCompleteWithinAsync(System.TimeSpan timeSpan, string because = "", params object[] becauseArgs) { }
}
}
namespace FluentAssertions.Streams
Expand Down

0 comments on commit 25706b2

Please sign in to comment.