Skip to content

Commit a020a36

Browse files
yorahnulltoken
authored andcommitted
Replace AssertExtensions.ShouldNotEqual method by Assert.NotEqual
1 parent d9c7e7a commit a020a36

10 files changed

+10
-15
lines changed

LibGit2Sharp.Tests/CommitFixture.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -636,7 +636,7 @@ private void AssertCommitHasBeenAmended(Repository repo, Commit amendedCommit, C
636636
Commit headCommit = repo.Head.Tip;
637637
Assert.Equal(amendedCommit, headCommit);
638638

639-
amendedCommit.Sha.ShouldNotEqual(originalCommit.Sha);
639+
Assert.NotEqual(originalCommit.Sha, amendedCommit.Sha);
640640
Assert.Equal(originalCommit.Parents, amendedCommit.Parents);
641641
}
642642

LibGit2Sharp.Tests/IndexFixture.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ public void CanStageTheUpdationOfAStagedFile()
125125
IndexEntry newBlob = repo.Index[filename];
126126

127127
Assert.Equal(count, repo.Index.Count);
128-
blob.Id.ShouldNotEqual(newBlob.Id);
128+
Assert.NotEqual(newBlob.Id, blob.Id);
129129
Assert.Equal(FileStatus.Added, repo.Index.RetrieveStatus(filename));
130130
}
131131
}
@@ -185,7 +185,7 @@ public void StagingANewVersionOfAFileThenUnstagingItRevertsTheBlobToTheVersionOf
185185
repo.Index.Stage(filename);
186186

187187
Assert.Equal(count, repo.Index.Count);
188-
repo.Index[posixifiedFileName].Id.ShouldNotEqual((blobId));
188+
Assert.NotEqual((blobId), repo.Index[posixifiedFileName].Id);
189189

190190
repo.Index.Unstage(posixifiedFileName);
191191
Assert.Equal(count, repo.Index.Count);

LibGit2Sharp.Tests/ObjectIdFixture.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public void DifferentObjectIdsDoesNotHaveSameHashCode()
6868
var a = new ObjectId(validSha1);
6969
var b = new ObjectId(validSha2);
7070

71-
a.GetHashCode().ShouldNotEqual(b.GetHashCode());
71+
Assert.NotEqual(b.GetHashCode(), a.GetHashCode());
7272
}
7373

7474
[Fact]

LibGit2Sharp.Tests/ReferenceFixture.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ public void CanUpdateTargetOnReference()
309309
{
310310
string sha = repo.Refs["refs/heads/test"].ResolveToDirectReference().Target.Sha;
311311
Reference master = repo.Refs[masterRef];
312-
master.ResolveToDirectReference().Target.Sha.ShouldNotEqual(sha);
312+
Assert.NotEqual(sha, master.ResolveToDirectReference().Target.Sha);
313313

314314
Reference updated = repo.Refs.UpdateTarget(masterRef, sha);
315315

LibGit2Sharp.Tests/RemoteFixture.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public void CanCheckEqualityOfRemote()
6262
Assert.NotNull(loadedRemote);
6363
Assert.Equal(createdRemote, loadedRemote);
6464

65-
loadedRemote.ShouldNotEqual(oneOrigin);
65+
Assert.NotEqual(oneOrigin, loadedRemote);
6666
}
6767
}
6868
}

LibGit2Sharp.Tests/RepositoryFixture.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ private static void CheckGitConfigFile(string dir)
6666
Assert.True(File.Exists(configFilePath));
6767

6868
string contents = File.ReadAllText(configFilePath);
69-
contents.IndexOf("repositoryformatversion = 0", StringComparison.Ordinal).ShouldNotEqual(-1);
69+
Assert.NotEqual(-1, contents.IndexOf("repositoryformatversion = 0", StringComparison.Ordinal));
7070
}
7171

7272
private static void AssertIsHidden(string repoPath)

LibGit2Sharp.Tests/TagFixture.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ public void CanCreateAnAnnotatedTagPointingToATagAnnotation()
352352
Assert.NotNull(tag);
353353
Assert.True(tag.IsAnnotated);
354354
Assert.Equal(annotation.Id, tag.Annotation.Target.Id);
355-
tag.Annotation.ShouldNotEqual(annotation);
355+
Assert.NotEqual(annotation, tag.Annotation);
356356

357357
Assert.Equal(tag, repo.Tags[tag.Name]);
358358
}

LibGit2Sharp.Tests/TestHelpers/AssertExtensions.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,5 @@ public static void ShouldBeAboutEqualTo(this DateTimeOffset expected, DateTimeOf
1313
Assert.Equal(expected.Minute, current.Minute);
1414
Assert.Equal(expected.Second, current.Second);
1515
}
16-
17-
public static void ShouldNotEqual(this object compareFrom, object compareTo)
18-
{
19-
Assert.NotEqual(compareTo, compareFrom);
20-
}
2116
}
2217
}

LibGit2Sharp.Tests/TreeFixture.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ public void CanRetrieveTreeEntryPath()
165165
Assert.NotNull(subTree);
166166
TreeEntry anInstance = subTree["branch_file.txt"];
167167

168-
anInstance.Path.ShouldNotEqual("branch_file.txt");
168+
Assert.NotEqual("branch_file.txt", anInstance.Path);
169169
Assert.Equal(completePath, anInstance.Path);
170170
Assert.Equal(completePath, subTree.First().Path);
171171

LibGit2Sharp.Tests/TupleFixture.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public void GetHashCodeIsDifferent()
3131
{
3232
var sut2 = new Tuple<int, string>(integer + 1, stringy);
3333

34-
sut.GetHashCode().ShouldNotEqual(sut2.GetHashCode());
34+
Assert.NotEqual(sut2.GetHashCode(), sut.GetHashCode());
3535
}
3636

3737
[Fact]

0 commit comments

Comments
 (0)