57
59
FileNameMatcher matcher = new FileNameMatcher(pattern, null);
58
60
matcher.Append(input);
59
NUnit.Framework.Assert.AreEqual(matchExpected, matcher.IsMatch());
60
NUnit.Framework.Assert.AreEqual(appendCanMatchExpected, matcher.CanAppendMatch());
61
Assert.AreEqual(matchExpected, matcher.IsMatch());
62
Assert.AreEqual(appendCanMatchExpected, matcher.CanAppendMatch());
63
65
/// <exception cref="NGit.Errors.InvalidPatternException"></exception>
67
69
FileNameMatcher matcher = new FileNameMatcher(pattern, excludedCharacter);
68
70
matcher.Append(input);
69
NUnit.Framework.Assert.AreEqual(matchExpected, matcher.IsMatch());
70
NUnit.Framework.Assert.AreEqual(appendCanMatchExpected, matcher.CanAppendMatch());
71
Assert.AreEqual(matchExpected, matcher.IsMatch());
72
Assert.AreEqual(appendCanMatchExpected, matcher.CanAppendMatch());
73
75
/// <exception cref="System.Exception"></exception>
1123
1125
string pattern = "helloworld";
1124
1126
FileNameMatcher matcher = new FileNameMatcher(pattern, null);
1125
1127
matcher.Append("helloworld");
1126
NUnit.Framework.Assert.AreEqual(true, matcher.IsMatch());
1127
NUnit.Framework.Assert.AreEqual(false, matcher.CanAppendMatch());
1128
NUnit.Framework.Assert.IsTrue(matcher.IsMatch());
1129
NUnit.Framework.Assert.IsFalse(matcher.CanAppendMatch());
1128
1130
matcher.Reset();
1129
1131
matcher.Append("hello");
1130
NUnit.Framework.Assert.AreEqual(false, matcher.IsMatch());
1131
NUnit.Framework.Assert.AreEqual(true, matcher.CanAppendMatch());
1132
NUnit.Framework.Assert.IsFalse(matcher.IsMatch());
1133
NUnit.Framework.Assert.IsTrue(matcher.CanAppendMatch());
1132
1134
matcher.Append("world");
1133
NUnit.Framework.Assert.AreEqual(true, matcher.IsMatch());
1134
NUnit.Framework.Assert.AreEqual(false, matcher.CanAppendMatch());
1135
NUnit.Framework.Assert.IsTrue(matcher.IsMatch());
1136
NUnit.Framework.Assert.IsFalse(matcher.CanAppendMatch());
1135
1137
matcher.Append("to much");
1136
NUnit.Framework.Assert.AreEqual(false, matcher.IsMatch());
1137
NUnit.Framework.Assert.AreEqual(false, matcher.CanAppendMatch());
1138
NUnit.Framework.Assert.IsFalse(matcher.IsMatch());
1139
NUnit.Framework.Assert.IsFalse(matcher.CanAppendMatch());
1138
1140
matcher.Reset();
1139
1141
matcher.Append("helloworld");
1140
NUnit.Framework.Assert.AreEqual(true, matcher.IsMatch());
1141
NUnit.Framework.Assert.AreEqual(false, matcher.CanAppendMatch());
1142
NUnit.Framework.Assert.IsTrue(matcher.IsMatch());
1143
NUnit.Framework.Assert.IsFalse(matcher.CanAppendMatch());
1144
1146
/// <exception cref="System.Exception"></exception>
1149
1151
FileNameMatcher matcher = new FileNameMatcher(pattern, null);
1150
1152
matcher.Append("hello");
1151
1153
FileNameMatcher childMatcher = matcher.CreateMatcherForSuffix();
1152
NUnit.Framework.Assert.AreEqual(false, matcher.IsMatch());
1153
NUnit.Framework.Assert.AreEqual(true, matcher.CanAppendMatch());
1154
NUnit.Framework.Assert.AreEqual(false, childMatcher.IsMatch());
1155
NUnit.Framework.Assert.AreEqual(true, childMatcher.CanAppendMatch());
1154
NUnit.Framework.Assert.IsFalse(matcher.IsMatch());
1155
NUnit.Framework.Assert.IsTrue(matcher.CanAppendMatch());
1156
NUnit.Framework.Assert.IsFalse(childMatcher.IsMatch());
1157
NUnit.Framework.Assert.IsTrue(childMatcher.CanAppendMatch());
1156
1158
matcher.Append("world");
1157
NUnit.Framework.Assert.AreEqual(true, matcher.IsMatch());
1158
NUnit.Framework.Assert.AreEqual(false, matcher.CanAppendMatch());
1159
NUnit.Framework.Assert.AreEqual(false, childMatcher.IsMatch());
1160
NUnit.Framework.Assert.AreEqual(true, childMatcher.CanAppendMatch());
1159
NUnit.Framework.Assert.IsTrue(matcher.IsMatch());
1160
NUnit.Framework.Assert.IsFalse(matcher.CanAppendMatch());
1161
NUnit.Framework.Assert.IsFalse(childMatcher.IsMatch());
1162
NUnit.Framework.Assert.IsTrue(childMatcher.CanAppendMatch());
1161
1163
childMatcher.Append("world");
1162
NUnit.Framework.Assert.AreEqual(true, matcher.IsMatch());
1163
NUnit.Framework.Assert.AreEqual(false, matcher.CanAppendMatch());
1164
NUnit.Framework.Assert.AreEqual(true, childMatcher.IsMatch());
1165
NUnit.Framework.Assert.AreEqual(false, childMatcher.CanAppendMatch());
1164
NUnit.Framework.Assert.IsTrue(matcher.IsMatch());
1165
NUnit.Framework.Assert.IsFalse(matcher.CanAppendMatch());
1166
NUnit.Framework.Assert.IsTrue(childMatcher.IsMatch());
1167
NUnit.Framework.Assert.IsFalse(childMatcher.CanAppendMatch());
1166
1168
childMatcher.Reset();
1167
NUnit.Framework.Assert.AreEqual(true, matcher.IsMatch());
1168
NUnit.Framework.Assert.AreEqual(false, matcher.CanAppendMatch());
1169
NUnit.Framework.Assert.AreEqual(false, childMatcher.IsMatch());
1170
NUnit.Framework.Assert.AreEqual(true, childMatcher.CanAppendMatch());
1169
NUnit.Framework.Assert.IsTrue(matcher.IsMatch());
1170
NUnit.Framework.Assert.IsFalse(matcher.CanAppendMatch());
1171
NUnit.Framework.Assert.IsFalse(childMatcher.IsMatch());
1172
NUnit.Framework.Assert.IsTrue(childMatcher.CanAppendMatch());
1171
1173
childMatcher.Append("world");
1172
NUnit.Framework.Assert.AreEqual(true, matcher.IsMatch());
1173
NUnit.Framework.Assert.AreEqual(false, matcher.CanAppendMatch());
1174
NUnit.Framework.Assert.AreEqual(true, childMatcher.IsMatch());
1175
NUnit.Framework.Assert.AreEqual(false, childMatcher.CanAppendMatch());
1174
NUnit.Framework.Assert.IsTrue(matcher.IsMatch());
1175
NUnit.Framework.Assert.IsFalse(matcher.CanAppendMatch());
1176
NUnit.Framework.Assert.IsTrue(childMatcher.IsMatch());
1177
NUnit.Framework.Assert.IsFalse(childMatcher.CanAppendMatch());
1178
1180
/// <exception cref="System.Exception"></exception>
1183
1185
FileNameMatcher matcher = new FileNameMatcher(pattern, null);
1184
1186
matcher.Append("hello");
1185
1187
FileNameMatcher copy = new FileNameMatcher(matcher);
1186
NUnit.Framework.Assert.AreEqual(false, matcher.IsMatch());
1187
NUnit.Framework.Assert.AreEqual(true, matcher.CanAppendMatch());
1188
NUnit.Framework.Assert.AreEqual(false, copy.IsMatch());
1189
NUnit.Framework.Assert.AreEqual(true, copy.CanAppendMatch());
1188
NUnit.Framework.Assert.IsFalse(matcher.IsMatch());
1189
NUnit.Framework.Assert.IsTrue(matcher.CanAppendMatch());
1190
NUnit.Framework.Assert.IsFalse(copy.IsMatch());
1191
NUnit.Framework.Assert.IsTrue(copy.CanAppendMatch());
1190
1192
matcher.Append("world");
1191
NUnit.Framework.Assert.AreEqual(true, matcher.IsMatch());
1192
NUnit.Framework.Assert.AreEqual(false, matcher.CanAppendMatch());
1193
NUnit.Framework.Assert.AreEqual(false, copy.IsMatch());
1194
NUnit.Framework.Assert.AreEqual(true, copy.CanAppendMatch());
1193
NUnit.Framework.Assert.IsTrue(matcher.IsMatch());
1194
NUnit.Framework.Assert.IsFalse(matcher.CanAppendMatch());
1195
NUnit.Framework.Assert.IsFalse(copy.IsMatch());
1196
NUnit.Framework.Assert.IsTrue(copy.CanAppendMatch());
1195
1197
copy.Append("world");
1196
NUnit.Framework.Assert.AreEqual(true, matcher.IsMatch());
1197
NUnit.Framework.Assert.AreEqual(false, matcher.CanAppendMatch());
1198
NUnit.Framework.Assert.AreEqual(true, copy.IsMatch());
1199
NUnit.Framework.Assert.AreEqual(false, copy.CanAppendMatch());
1198
NUnit.Framework.Assert.IsTrue(matcher.IsMatch());
1199
NUnit.Framework.Assert.IsFalse(matcher.CanAppendMatch());
1200
NUnit.Framework.Assert.IsTrue(copy.IsMatch());
1201
NUnit.Framework.Assert.IsFalse(copy.CanAppendMatch());
1201
NUnit.Framework.Assert.AreEqual(true, matcher.IsMatch());
1202
NUnit.Framework.Assert.AreEqual(false, matcher.CanAppendMatch());
1203
NUnit.Framework.Assert.AreEqual(false, copy.IsMatch());
1204
NUnit.Framework.Assert.AreEqual(true, copy.CanAppendMatch());
1203
NUnit.Framework.Assert.IsTrue(matcher.IsMatch());
1204
NUnit.Framework.Assert.IsFalse(matcher.CanAppendMatch());
1205
NUnit.Framework.Assert.IsFalse(copy.IsMatch());
1206
NUnit.Framework.Assert.IsTrue(copy.CanAppendMatch());
1205
1207
copy.Append("helloworld");
1206
NUnit.Framework.Assert.AreEqual(true, matcher.IsMatch());
1207
NUnit.Framework.Assert.AreEqual(false, matcher.CanAppendMatch());
1208
NUnit.Framework.Assert.AreEqual(true, copy.IsMatch());
1209
NUnit.Framework.Assert.AreEqual(false, copy.CanAppendMatch());
1208
NUnit.Framework.Assert.IsTrue(matcher.IsMatch());
1209
NUnit.Framework.Assert.IsFalse(matcher.CanAppendMatch());
1210
NUnit.Framework.Assert.IsTrue(copy.IsMatch());
1211
NUnit.Framework.Assert.IsFalse(copy.CanAppendMatch());