Beispiel #1
0
 public void WhenSameCaptureNameReused_ExpectLastValue()
 {
     Command command = new Command(@"^(?<name>[a-z]+).*?(?<name>[0-9]+)");
     Pickup pickup = new Pickup();
     pickup.CollectAllPickupsInLine("ab c 45", command);
     var results = pickup.ReplacePickupsWithStoredValue("${name}");
     Assert.AreEqual("45", results);
 }
Beispiel #2
0
 public void WhenTwoCapturesGiven_ExpectTwo()
 {
     Command command = new Command("^(?<name>[a-z]+).*?(?<second>[0-9]+)");
     Pickup pickup = new Pickup();
     pickup.CollectAllPickupsInLine("ab c 45", command);
     var results = pickup.ReplacePickupsWithStoredValue("${name}");
     Assert.AreEqual("ab", results);
     results = pickup.ReplacePickupsWithStoredValue("${second}");
     Assert.AreEqual("45",results);
 }
Beispiel #3
0
 public void WhenGlobPickup_ExpectHeldValue()
 {
     Command command = new Command(@"a{name}d");
     Pickup pickup = new Pickup();
     pickup.CollectAllPickupsInLine("ab cd",command);
     string results = pickup.ReplacePickupsWithStoredValue("ab${name}");
     Assert.AreEqual("abb c", results);
 }