Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add assert attributes to assert methods #172

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/Snapshooter.Json/JsonAssert.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using Snapshooter.Core;
using Snapshooter.Exceptions;

Expand All @@ -15,6 +15,7 @@ public class JsonAssert : IAssert
/// </summary>
/// <param name="expectedSnapshot">The expected snapshot.</param>
/// <param name="actualSnapshot">The actual snapshot.</param>
[AssertionMethod]
public virtual void Assert(string expectedSnapshot, string actualSnapshot)
{
int snapshotCompare = string.Compare(
Expand Down
6 changes: 5 additions & 1 deletion src/Snapshooter.Json/Snapshot.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using Snapshooter.Core;
using Snapshooter.Core.Serialization;

Expand Down Expand Up @@ -26,6 +26,7 @@ public static class Snapshot
/// <param name="matchOptions">
/// Additional compare actions, which can be applied during the comparison
/// </param>
[AssertionMethod]
public static void Match<T>(T currentResult,
string snapshotName,
Func<MatchOptions, MatchOptions> matchOptions = null)
Expand Down Expand Up @@ -56,6 +57,7 @@ public static void Match<T>(T currentResult,
/// <param name="matchOptions">
/// Additional compare actions, which can be applied during the comparison
/// </param>
[AssertionMethod]
public static void Match<T>(T currentResult,
string snapshotName,
SnapshotNameExtension snapshotNameExtension,
Expand All @@ -77,6 +79,7 @@ public static void Match<T>(T currentResult,
/// <param name="matchOptions">
/// Additional compare actions, which can be applied during the comparison
/// </param>
[AssertionMethod]
public static void Match(object currentResult,
string snapshotName,
Func<MatchOptions, MatchOptions> matchOptions = null)
Expand Down Expand Up @@ -108,6 +111,7 @@ public static void Match(object currentResult,
/// <param name="matchOptions">
/// Additional compare actions, which can be applied during the comparison
/// </param>
[AssertionMethod]
public static void Match(object currentResult,
string snapshotName,
SnapshotNameExtension snapshotNameExtension,
Expand Down
10 changes: 10 additions & 0 deletions src/Snapshooter.MSTest/Snapshot.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ public static class Snapshot
/// <param name="matchOptions">
/// Additional compare actions, which can be applied during the snapshot comparison
/// </param>
[AssertionMethod]
public static void Match<T>(
T currentResult,
Func<MatchOptions, MatchOptions> matchOptions = null)
Expand Down Expand Up @@ -54,6 +55,7 @@ public static void Match<T>(
/// <param name="matchOptions">
/// Additional compare actions, which can be applied during the snapshot comparison
/// </param>
[AssertionMethod]
public static void Match<T>(
T currentResult,
SnapshotNameExtension snapshotNameExtension,
Expand All @@ -77,6 +79,7 @@ public static void Match<T>(
/// <param name="matchOptions">
/// Additional compare actions, which can be applied during the snapshot comparison
/// </param>
[AssertionMethod]
public static void Match<T>(
T currentResult,
string snapshotName,
Expand Down Expand Up @@ -109,6 +112,7 @@ public static void Match<T>(
/// <param name="matchOptions">
/// Additional compare actions, which can be applied during the snapshot comparison
/// </param>
[AssertionMethod]
public static void Match<T>(
T currentResult,
string snapshotName,
Expand All @@ -130,6 +134,7 @@ public static void Match<T>(
/// <param name="matchOptions">
/// Additional compare actions, which can be applied during the snapshot comparison.
/// </param>
[AssertionMethod]
public static void Match<T>(
T currentResult,
SnapshotFullName snapshotFullName,
Expand All @@ -148,6 +153,7 @@ public static void Match<T>(
/// <param name="matchOptions">
/// Additional compare actions, which can be applied during the snapshot comparison
/// </param>
[AssertionMethod]
public static void Match(
object currentResult,
Func<MatchOptions, MatchOptions> matchOptions = null)
Expand Down Expand Up @@ -181,6 +187,7 @@ public static void Match(
/// <param name="matchOptions">
/// Additional compare actions, which can be applied during the snapshot comparison
/// </param>
[AssertionMethod]
public static void Match(
object currentResult,
SnapshotNameExtension snapshotNameExtension,
Expand All @@ -203,6 +210,7 @@ public static void Match(
/// <param name="matchOptions">
/// Additional compare actions, which can be applied during the snapshot comparison
/// </param>
[AssertionMethod]
public static void Match(
object currentResult,
string snapshotName,
Expand Down Expand Up @@ -234,6 +242,7 @@ public static void Match(
/// <param name="matchOptions">
/// Additional compare actions, which can be applied during the snapshot comparison.
/// </param>
[AssertionMethod]
public static void Match(
object currentResult,
string snapshotName,
Expand All @@ -255,6 +264,7 @@ public static void Match(
/// <param name="matchOptions">
/// Additional compare actions, which can be applied during the snapshot comparison.
/// </param>
[AssertionMethod]
public static void Match(
object currentResult,
SnapshotFullName snapshotFullName,
Expand Down
5 changes: 5 additions & 0 deletions src/Snapshooter.MSTest/SnapshotExtension.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ public static class SnapshotExtension
/// <param name="matchOptions">
/// Additional compare actions, which can be applied during the snapshot comparison
/// </param>
[AssertionMethod]
public static void MatchSnapshot(
this object currentResult,
Func<MatchOptions, MatchOptions> matchOptions = null)
Expand Down Expand Up @@ -41,6 +42,7 @@ public static void MatchSnapshot(
/// <param name="matchOptions">
/// Additional compare actions, which can be applied during the snapshot comparison
/// </param>
[AssertionMethod]
public static void MatchSnapshot(
this object currentResult,
SnapshotNameExtension snapshotNameExtension,
Expand All @@ -64,6 +66,7 @@ public static void MatchSnapshot(
/// <param name="matchOptions">
/// Additional compare actions, which can be applied during the snapshot comparison
/// </param>
[AssertionMethod]
public static void MatchSnapshot(
this object currentResult,
string snapshotName,
Expand Down Expand Up @@ -96,6 +99,7 @@ public static void MatchSnapshot(
/// <param name="matchOptions">
/// Additional compare actions, which can be applied during the snapshot comparison.
/// </param>
[AssertionMethod]
public static void MatchSnapshot(
this object currentResult,
string snapshotName,
Expand All @@ -119,6 +123,7 @@ public static void MatchSnapshot(
/// <param name="matchOptions">
/// Additional compare actions, which can be applied during the snapshot comparison.
/// </param>
[AssertionMethod]
public static void MatchSnapshot(
this object currentResult,
SnapshotFullName snapshotFullName,
Expand Down
12 changes: 11 additions & 1 deletion src/Snapshooter.NUnit/Snapshot.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Threading;
using Snapshooter.Core;
using Snapshooter.Core.Serialization;
Expand Down Expand Up @@ -28,6 +28,7 @@ public static class Snapshot
/// <param name="matchOptions">
/// Additional compare actions, which can be applied during the snapshot comparison
/// </param>
[AssertionMethod]
public static void Match<T>(
T currentResult,
Func<MatchOptions, MatchOptions> matchOptions = null)
Expand Down Expand Up @@ -55,6 +56,7 @@ public static void Match<T>(
/// <param name="matchOptions">
/// Additional compare actions, which can be applied during the snapshot comparison
/// </param>
[AssertionMethod]
public static void Match<T>(
T currentResult,
SnapshotNameExtension snapshotNameExtension,
Expand All @@ -78,6 +80,7 @@ public static void Match<T>(
/// <param name="matchOptions">
/// Additional compare actions, which can be applied during the snapshot comparison
/// </param>
[AssertionMethod]
public static void Match<T>(
T currentResult,
string snapshotName,
Expand Down Expand Up @@ -110,6 +113,7 @@ public static void Match<T>(
/// <param name="matchOptions">
/// Additional compare actions, which can be applied during the snapshot comparison
/// </param>
[AssertionMethod]
public static void Match<T>(
T currentResult,
string snapshotName,
Expand All @@ -131,6 +135,7 @@ public static void Match<T>(
/// <param name="matchOptions">
/// Additional compare actions, which can be applied during the snapshot comparison.
/// </param>
[AssertionMethod]
public static void Match<T>(
T currentResult,
SnapshotFullName snapshotFullName,
Expand All @@ -149,6 +154,7 @@ public static void Match<T>(
/// <param name="matchOptions">
/// Additional compare actions, which can be applied during the snapshot comparison
/// </param>
[AssertionMethod]
public static void Match(
object currentResult,
Func<MatchOptions, MatchOptions> matchOptions = null)
Expand All @@ -175,6 +181,7 @@ public static void Match(
/// <param name="matchOptions">
/// Additional compare actions, which can be applied during the snapshot comparison
/// </param>
[AssertionMethod]
public static void Match(
object currentResult,
SnapshotNameExtension snapshotNameExtension,
Expand All @@ -197,6 +204,7 @@ public static void Match(
/// <param name="matchOptions">
/// Additional compare actions, which can be applied during the snapshot comparison
/// </param>
[AssertionMethod]
public static void Match(
object currentResult,
string snapshotName,
Expand Down Expand Up @@ -228,6 +236,7 @@ public static void Match(
/// <param name="matchOptions">
/// Additional compare actions, which can be applied during the snapshot comparison.
/// </param>
[AssertionMethod]
public static void Match(
object currentResult,
string snapshotName,
Expand All @@ -249,6 +258,7 @@ public static void Match(
/// <param name="matchOptions">
/// Additional compare actions, which can be applied during the snapshot comparison.
/// </param>
[AssertionMethod]
public static void Match(
object currentResult,
SnapshotFullName snapshotFullName,
Expand Down
5 changes: 5 additions & 0 deletions src/Snapshooter.NUnit/SnapshotExtension.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ public static class SnapshotExtension
/// <param name="matchOptions">
/// Additional compare actions, which can be applied during the snapshot comparison
/// </param>
[AssertionMethod]
public static void MatchSnapshot(
this object currentResult,
Func<MatchOptions, MatchOptions> matchOptions = null)
Expand Down Expand Up @@ -41,6 +42,7 @@ public static void MatchSnapshot(
/// <param name="matchOptions">
/// Additional compare actions, which can be applied during the snapshot comparison
/// </param>
[AssertionMethod]
public static void MatchSnapshot(
this object currentResult,
SnapshotNameExtension snapshotNameExtension,
Expand All @@ -64,6 +66,7 @@ public static void MatchSnapshot(
/// <param name="matchOptions">
/// Additional compare actions, which can be applied during the snapshot comparison
/// </param>
[AssertionMethod]
public static void MatchSnapshot(
this object currentResult,
string snapshotName,
Expand Down Expand Up @@ -96,6 +99,7 @@ public static void MatchSnapshot(
/// <param name="matchOptions">
/// Additional compare actions, which can be applied during the snapshot comparison.
/// </param>
[AssertionMethod]
public static void MatchSnapshot(
this object currentResult,
string snapshotName,
Expand All @@ -119,6 +123,7 @@ public static void MatchSnapshot(
/// <param name="matchOptions">
/// Additional compare actions, which can be applied during the snapshot comparison.
/// </param>
[AssertionMethod]
public static void MatchSnapshot(
this object currentResult,
SnapshotFullName snapshotFullName,
Expand Down
12 changes: 11 additions & 1 deletion src/Snapshooter.Xunit/Snapshot.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Threading;
using Snapshooter.Core;
using Snapshooter.Core.Serialization;
Expand Down Expand Up @@ -28,6 +28,7 @@ public static class Snapshot
/// <param name="matchOptions">
/// Additional compare actions, which can be applied during the snapshot comparison
/// </param>
[AssertionMethod]
public static void Match<T>(
T currentResult,
Func<MatchOptions, MatchOptions> matchOptions = null)
Expand Down Expand Up @@ -55,6 +56,7 @@ public static void Match<T>(
/// <param name="matchOptions">
/// Additional compare actions, which can be applied during the snapshot comparison
/// </param>
[AssertionMethod]
public static void Match<T>(
T currentResult,
SnapshotNameExtension snapshotNameExtension,
Expand All @@ -78,6 +80,7 @@ public static void Match<T>(
/// <param name="matchOptions">
/// Additional compare actions, which can be applied during the snapshot comparison
/// </param>
[AssertionMethod]
public static void Match<T>(
T currentResult,
string snapshotName,
Expand Down Expand Up @@ -110,6 +113,7 @@ public static void Match<T>(
/// <param name="matchOptions">
/// Additional compare actions, which can be applied during the snapshot comparison
/// </param>
[AssertionMethod]
public static void Match<T>(
T currentResult,
string snapshotName,
Expand All @@ -131,6 +135,7 @@ public static void Match<T>(
/// <param name="matchOptions">
/// Additional compare actions, which can be applied during the snapshot comparison.
/// </param>
[AssertionMethod]
public static void Match<T>(
T currentResult,
SnapshotFullName snapshotFullName,
Expand All @@ -149,6 +154,7 @@ public static void Match<T>(
/// <param name="matchOptions">
/// Additional compare actions, which can be applied during the snapshot comparison
/// </param>
[AssertionMethod]
public static void Match(
object currentResult,
Func<MatchOptions, MatchOptions> matchOptions = null)
Expand Down Expand Up @@ -182,6 +188,7 @@ public static void Match(
/// <param name="matchOptions">
/// Additional compare actions, which can be applied during the snapshot comparison
/// </param>
[AssertionMethod]
public static void Match(
object currentResult,
SnapshotNameExtension snapshotNameExtension,
Expand All @@ -204,6 +211,7 @@ public static void Match(
/// <param name="matchOptions">
/// Additional compare actions, which can be applied during the snapshot comparison
/// </param>
[AssertionMethod]
public static void Match(
object currentResult,
string snapshotName,
Expand Down Expand Up @@ -235,6 +243,7 @@ public static void Match(
/// <param name="matchOptions">
/// Additional compare actions, which can be applied during the snapshot comparison.
/// </param>
[AssertionMethod]
public static void Match(
object currentResult,
string snapshotName,
Expand All @@ -256,6 +265,7 @@ public static void Match(
/// <param name="matchOptions">
/// Additional compare actions, which can be applied during the snapshot comparison.
/// </param>
[AssertionMethod]
public static void Match(
object currentResult,
SnapshotFullName snapshotFullName,
Expand Down
Loading