Skip to content

Commit

Permalink
Updated unit tests to use interpolated strings in Assert.Fail()
Browse files Browse the repository at this point in the history
  • Loading branch information
jstedfast committed Dec 9, 2023
1 parent 75a92b0 commit 709a63a
Show file tree
Hide file tree
Showing 17 changed files with 890 additions and 890 deletions.
32 changes: 16 additions & 16 deletions UnitTests/AnnotationEntryTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ public void TestParse ()
try {
entry = AnnotationEntry.Parse ("/comment");
} catch (Exception ex) {
Assert.Fail ("Did not expect: {0}", ex);
Assert.Fail ($"Did not expect: {ex}");
return;
}
Assert.AreEqual ("/comment", entry.Entry, "Entry");
Expand All @@ -176,7 +176,7 @@ public void TestParse ()
try {
entry = AnnotationEntry.Parse ("/comment.priv");
} catch (Exception ex) {
Assert.Fail ("Did not expect: {0}", ex);
Assert.Fail ($"Did not expect: {ex}");
return;
}
Assert.AreEqual ("/comment.priv", entry.Entry, "Entry");
Expand All @@ -187,7 +187,7 @@ public void TestParse ()
try {
entry = AnnotationEntry.Parse ("/comment.shared");
} catch (Exception ex) {
Assert.Fail ("Did not expect: {0}", ex);
Assert.Fail ($"Did not expect: {ex}");
return;
}
entry = new AnnotationEntry ("/comment", AnnotationScope.Shared);
Expand All @@ -199,7 +199,7 @@ public void TestParse ()
try {
entry = AnnotationEntry.Parse ("/1.2.3.4/comment");
} catch (Exception ex) {
Assert.Fail ("Did not expect: {0}", ex);
Assert.Fail ($"Did not expect: {ex}");
return;
}
Assert.AreEqual ("/1.2.3.4/comment", entry.Entry, "Entry");
Expand All @@ -210,7 +210,7 @@ public void TestParse ()
try {
entry = AnnotationEntry.Parse ("/1.2.3.4/comment.priv");
} catch (Exception ex) {
Assert.Fail ("Did not expect: {0}", ex);
Assert.Fail ($"Did not expect: {ex}");
return;
}
Assert.AreEqual ("/1.2.3.4/comment.priv", entry.Entry, "Entry");
Expand All @@ -221,7 +221,7 @@ public void TestParse ()
try {
entry = AnnotationEntry.Parse ("/1.2.3.4/comment.shared");
} catch (Exception ex) {
Assert.Fail ("Did not expect: {0}", ex);
Assert.Fail ($"Did not expect: {ex}");
return;
}
Assert.AreEqual ("/1.2.3.4/comment.shared", entry.Entry, "Entry");
Expand All @@ -238,79 +238,79 @@ public void TestCreate ()
try {
entry = AnnotationEntry.Create ("/comment");
} catch (Exception ex) {
Assert.Fail ("Did not expect: {0}", ex);
Assert.Fail ($"Did not expect: {ex}");
return;
}
Assert.AreEqual (AnnotationEntry.Comment, entry, "/comment");

try {
entry = AnnotationEntry.Create ("/comment.priv");
} catch (Exception ex) {
Assert.Fail ("Did not expect: {0}", ex);
Assert.Fail ($"Did not expect: {ex}");
return;
}
Assert.AreEqual (AnnotationEntry.PrivateComment, entry, "/comment.priv");

try {
entry = AnnotationEntry.Create ("/comment.shared");
} catch (Exception ex) {
Assert.Fail ("Did not expect: {0}", ex);
Assert.Fail ($"Did not expect: {ex}");
return;
}
Assert.AreEqual (AnnotationEntry.SharedComment, entry, "/comment.shared");

try {
entry = AnnotationEntry.Create ("/flags");
} catch (Exception ex) {
Assert.Fail ("Did not expect: {0}", ex);
Assert.Fail ($"Did not expect: {ex}");
return;
}
Assert.AreEqual (AnnotationEntry.Flags, entry, "/flags");

try {
entry = AnnotationEntry.Create ("/flags.priv");
} catch (Exception ex) {
Assert.Fail ("Did not expect: {0}", ex);
Assert.Fail ($"Did not expect: {ex}");
return;
}
Assert.AreEqual (AnnotationEntry.PrivateFlags, entry, "/flags.priv");

try {
entry = AnnotationEntry.Create ("/flags.shared");
} catch (Exception ex) {
Assert.Fail ("Did not expect: {0}", ex);
Assert.Fail ($"Did not expect: {ex}");
return;
}
Assert.AreEqual (AnnotationEntry.SharedFlags, entry, "/flags.shared");

try {
entry = AnnotationEntry.Create ("/altsubject");
} catch (Exception ex) {
Assert.Fail ("Did not expect: {0}", ex);
Assert.Fail ($"Did not expect: {ex}");
return;
}
Assert.AreEqual (AnnotationEntry.AltSubject, entry, "/altsubject");

try {
entry = AnnotationEntry.Create ("/altsubject.priv");
} catch (Exception ex) {
Assert.Fail ("Did not expect: {0}", ex);
Assert.Fail ($"Did not expect: {ex}");
return;
}
Assert.AreEqual (AnnotationEntry.PrivateAltSubject, entry, "/altsubject.priv");

try {
entry = AnnotationEntry.Create ("/altsubject.shared");
} catch (Exception ex) {
Assert.Fail ("Did not expect: {0}", ex);
Assert.Fail ($"Did not expect: {ex}");
return;
}
Assert.AreEqual (AnnotationEntry.SharedAltSubject, entry, "/altsubject.shared");

try {
entry = AnnotationEntry.Create ("/1.2.3.4/comment");
} catch (Exception ex) {
Assert.Fail ("Did not expect: {0}", ex);
Assert.Fail ($"Did not expect: {ex}");
return;
}
Assert.AreEqual ("/1.2.3.4/comment", entry.Entry, "Entry");
Expand Down
Loading

0 comments on commit 709a63a

Please sign in to comment.