~ubuntu-branches/ubuntu/trusty/monodevelop/trusty-proposed

« back to all changes in this revision

Viewing changes to external/ngit/NGit.Test/NGit.Fnmatch/FileNameMatcherTest.cs

  • Committer: Package Import Robot
  • Author(s): Jo Shields
  • Date: 2013-05-12 09:46:03 UTC
  • mto: This revision was merged to the branch mainline in revision 29.
  • Revision ID: package-import@ubuntu.com-20130512094603-mad323bzcxvmcam0
Tags: upstream-4.0.5+dfsg
ImportĀ upstreamĀ versionĀ 4.0.5+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
43
43
 
44
44
using NGit.Errors;
45
45
using NGit.Fnmatch;
 
46
using NGit.Junit;
46
47
using Sharpen;
 
48
using NUnit.Framework;
47
49
 
48
50
namespace NGit.Fnmatch
49
51
{
56
58
                {
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());
61
63
                }
62
64
 
63
65
                /// <exception cref="NGit.Errors.InvalidPatternException"></exception>
66
68
                {
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());
71
73
                }
72
74
 
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());
1142
1144
                }
1143
1145
 
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());
1176
1178
                }
1177
1179
 
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());
1200
1202
                        copy.Reset();
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());
1210
1212
                }
1211
1213
        }
1212
1214
}