-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path99)MiscDemos.cs
26 lines (21 loc) · 1016 Bytes
/
99)MiscDemos.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
using AbcStuff.Stubs.Args;
using System.Runtime.CompilerServices;
namespace ExtensionsTests.Exceptions;
public class MiscDemos
{
[Test]
public void ShowOverwriteOfRuntimeSet() {
Assert.That(Login("user123", "***"), Is.EqualTo(nameof(ShowOverwriteOfRuntimeSet)));
Assert.That(Login("user123", "***", "cool hacker"), Is.EqualTo("cool hacker"));
}
[Test]
public void HitLimitSwitch() {
DuplicatedArgument.ThrowIfAny("A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K");
Assert.Throws<InvalidOperationException>(() =>
DuplicatedArgument.ThrowIfAny("A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K",
new YOU_REACHED_ARGs_LIMIT___METAs_NEXT()));
DuplicatedArgument.ThrowIfAny("A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K",
default, "BAD TRICK: `default` can overwrite");
}
private static string Login(string name, string password, [CallerMemberName] string user = "<will be set by caller>") => user;
}