Skip to content

Commit

Permalink
Merge pull request #1972 from lg2de/protected-base-class
Browse files Browse the repository at this point in the history
Prepare constructors of `AsyncFunctionAssertions` to make them protected in V7
  • Loading branch information
jnyrup committed Aug 15, 2022
2 parents 98fbfb2 + f70a598 commit 288c847
Show file tree
Hide file tree
Showing 9 changed files with 30 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Src/FluentAssertions/Specialized/AsyncFunctionAssertions.cs
Expand Up @@ -15,11 +15,13 @@ public class AsyncFunctionAssertions<TTask, TAssertions> : DelegateAssertionsBas
where TTask : Task
where TAssertions : AsyncFunctionAssertions<TTask, TAssertions>
{
[Obsolete("This class is intended as base class. This ctor is accidentally public and will be removed in Version 7.")]
public AsyncFunctionAssertions(Func<TTask> subject, IExtractExceptions extractor)
: this(subject, extractor, new Clock())
{
}

[Obsolete("This class is intended as base class. This ctor is accidentally public and will be made protected in Version 7.")]
public AsyncFunctionAssertions(Func<TTask> subject, IExtractExceptions extractor, IClock clock)
: base(subject, extractor, clock)
{
Expand Down
Expand Up @@ -14,7 +14,9 @@ public GenericAsyncFunctionAssertions(Func<Task<TResult>> subject, IExtractExcep
}

public GenericAsyncFunctionAssertions(Func<Task<TResult>> subject, IExtractExceptions extractor, IClock clock)
#pragma warning disable CS0618 // is currently obsolete to make it protected in Version 7
: base(subject, extractor, clock)
#pragma warning restore CS0618
{
}

Expand Down
Expand Up @@ -12,7 +12,9 @@ public NonGenericAsyncFunctionAssertions(Func<Task> subject, IExtractExceptions
}

public NonGenericAsyncFunctionAssertions(Func<Task> subject, IExtractExceptions extractor, IClock clock)
#pragma warning disable CS0618 // is currently obsolete to make it protected in Version 7
: base(subject, extractor, clock)
#pragma warning restore CS0618
{
}
}
Expand Up @@ -2242,7 +2242,11 @@ namespace FluentAssertions.Specialized
where TTask : System.Threading.Tasks.Task
where TAssertions : FluentAssertions.Specialized.AsyncFunctionAssertions<TTask, TAssertions>
{
[System.Obsolete("This class is intended as base class. This ctor is accidentally public and will b" +
"e removed in Version 7.")]
public AsyncFunctionAssertions(System.Func<TTask> subject, FluentAssertions.Specialized.IExtractExceptions extractor) { }
[System.Obsolete("This class is intended as base class. This ctor is accidentally public and will b" +
"e made protected in Version 7.")]
public AsyncFunctionAssertions(System.Func<TTask> subject, FluentAssertions.Specialized.IExtractExceptions extractor, FluentAssertions.Common.IClock clock) { }
protected override string Identifier { get; }
public System.Threading.Tasks.Task<FluentAssertions.AndConstraint<TAssertions>> CompleteWithinAsync(System.TimeSpan timeSpan, string because = "", params object[] becauseArgs) { }
Expand Down
Expand Up @@ -2361,7 +2361,11 @@ namespace FluentAssertions.Specialized
where TTask : System.Threading.Tasks.Task
where TAssertions : FluentAssertions.Specialized.AsyncFunctionAssertions<TTask, TAssertions>
{
[System.Obsolete("This class is intended as base class. This ctor is accidentally public and will b" +
"e removed in Version 7.")]
public AsyncFunctionAssertions(System.Func<TTask> subject, FluentAssertions.Specialized.IExtractExceptions extractor) { }
[System.Obsolete("This class is intended as base class. This ctor is accidentally public and will b" +
"e made protected in Version 7.")]
public AsyncFunctionAssertions(System.Func<TTask> subject, FluentAssertions.Specialized.IExtractExceptions extractor, FluentAssertions.Common.IClock clock) { }
protected override string Identifier { get; }
public System.Threading.Tasks.Task<FluentAssertions.AndConstraint<TAssertions>> CompleteWithinAsync(System.TimeSpan timeSpan, string because = "", params object[] becauseArgs) { }
Expand Down
Expand Up @@ -2242,7 +2242,11 @@ namespace FluentAssertions.Specialized
where TTask : System.Threading.Tasks.Task
where TAssertions : FluentAssertions.Specialized.AsyncFunctionAssertions<TTask, TAssertions>
{
[System.Obsolete("This class is intended as base class. This ctor is accidentally public and will b" +
"e removed in Version 7.")]
public AsyncFunctionAssertions(System.Func<TTask> subject, FluentAssertions.Specialized.IExtractExceptions extractor) { }
[System.Obsolete("This class is intended as base class. This ctor is accidentally public and will b" +
"e made protected in Version 7.")]
public AsyncFunctionAssertions(System.Func<TTask> subject, FluentAssertions.Specialized.IExtractExceptions extractor, FluentAssertions.Common.IClock clock) { }
protected override string Identifier { get; }
public System.Threading.Tasks.Task<FluentAssertions.AndConstraint<TAssertions>> CompleteWithinAsync(System.TimeSpan timeSpan, string because = "", params object[] becauseArgs) { }
Expand Down
Expand Up @@ -2242,7 +2242,11 @@ namespace FluentAssertions.Specialized
where TTask : System.Threading.Tasks.Task
where TAssertions : FluentAssertions.Specialized.AsyncFunctionAssertions<TTask, TAssertions>
{
[System.Obsolete("This class is intended as base class. This ctor is accidentally public and will b" +
"e removed in Version 7.")]
public AsyncFunctionAssertions(System.Func<TTask> subject, FluentAssertions.Specialized.IExtractExceptions extractor) { }
[System.Obsolete("This class is intended as base class. This ctor is accidentally public and will b" +
"e made protected in Version 7.")]
public AsyncFunctionAssertions(System.Func<TTask> subject, FluentAssertions.Specialized.IExtractExceptions extractor, FluentAssertions.Common.IClock clock) { }
protected override string Identifier { get; }
public System.Threading.Tasks.Task<FluentAssertions.AndConstraint<TAssertions>> CompleteWithinAsync(System.TimeSpan timeSpan, string because = "", params object[] becauseArgs) { }
Expand Down
Expand Up @@ -2194,7 +2194,11 @@ namespace FluentAssertions.Specialized
where TTask : System.Threading.Tasks.Task
where TAssertions : FluentAssertions.Specialized.AsyncFunctionAssertions<TTask, TAssertions>
{
[System.Obsolete("This class is intended as base class. This ctor is accidentally public and will b" +
"e removed in Version 7.")]
public AsyncFunctionAssertions(System.Func<TTask> subject, FluentAssertions.Specialized.IExtractExceptions extractor) { }
[System.Obsolete("This class is intended as base class. This ctor is accidentally public and will b" +
"e made protected in Version 7.")]
public AsyncFunctionAssertions(System.Func<TTask> subject, FluentAssertions.Specialized.IExtractExceptions extractor, FluentAssertions.Common.IClock clock) { }
protected override string Identifier { get; }
public System.Threading.Tasks.Task<FluentAssertions.AndConstraint<TAssertions>> CompleteWithinAsync(System.TimeSpan timeSpan, string because = "", params object[] becauseArgs) { }
Expand Down
Expand Up @@ -2242,7 +2242,11 @@ namespace FluentAssertions.Specialized
where TTask : System.Threading.Tasks.Task
where TAssertions : FluentAssertions.Specialized.AsyncFunctionAssertions<TTask, TAssertions>
{
[System.Obsolete("This class is intended as base class. This ctor is accidentally public and will b" +
"e removed in Version 7.")]
public AsyncFunctionAssertions(System.Func<TTask> subject, FluentAssertions.Specialized.IExtractExceptions extractor) { }
[System.Obsolete("This class is intended as base class. This ctor is accidentally public and will b" +
"e made protected in Version 7.")]
public AsyncFunctionAssertions(System.Func<TTask> subject, FluentAssertions.Specialized.IExtractExceptions extractor, FluentAssertions.Common.IClock clock) { }
protected override string Identifier { get; }
public System.Threading.Tasks.Task<FluentAssertions.AndConstraint<TAssertions>> CompleteWithinAsync(System.TimeSpan timeSpan, string because = "", params object[] becauseArgs) { }
Expand Down

0 comments on commit 288c847

Please sign in to comment.