OLD | NEW |
1 /* | 1 /* |
2 Copyright 2010 Google Inc | 2 Copyright 2010 Google Inc |
3 | 3 |
4 Licensed under the Apache License, Version 2.0 (the "License"); | 4 Licensed under the Apache License, Version 2.0 (the "License"); |
5 you may not use this file except in compliance with the License. | 5 you may not use this file except in compliance with the License. |
6 You may obtain a copy of the License at | 6 You may obtain a copy of the License at |
7 | 7 |
8 http://www.apache.org/licenses/LICENSE-2.0 | 8 http://www.apache.org/licenses/LICENSE-2.0 |
9 | 9 |
10 Unless required by applicable law or agreed to in writing, software | 10 Unless required by applicable law or agreed to in writing, software |
11 distributed under the License is distributed on an "AS IS" BASIS, | 11 distributed under the License is distributed on an "AS IS" BASIS, |
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
13 See the License for the specific language governing permissions and | 13 See the License for the specific language governing permissions and |
14 limitations under the License. | 14 limitations under the License. |
15 */ | 15 */ |
16 | 16 |
17 using System.Collections.Generic; | |
18 | 17 |
19 using NUnit.Framework; | 18 using NUnit.Framework; |
20 | 19 |
21 using Google.Apis.Discovery; | 20 using Google.Apis.Discovery; |
22 using Google.Apis.Requests; | 21 using Google.Apis.Requests.Parameters; |
23 using Google.Apis.Testing; | |
24 | 22 |
25 namespace Google.Apis.Tests.Apis.Requests | 23 namespace Google.Apis.Tests.Apis.Requests |
26 { | 24 { |
27 /// <summary> Tests <see cref="Google.Api.Requests.ParameterValidator"/>. </
summary> | 25 /// <summary>Tests <see cref="Google.Api.Requests.ParameterValidator"/>.</su
mmary> |
28 [TestFixture] | 26 [TestFixture] |
29 public class ParameterValidatorTest | 27 public class ParameterValidatorTest |
30 { | 28 { |
31 /// <summary> Tests that validate regex returns <c>false</c> on empty pa
rameter sets. </summary> | 29 /// <summary>Tests that validate regex returns <c>false</c> on empty par
ameter sets.</summary> |
32 [Test] | 30 [Test] |
33 public void ValidateRegexEmptyNeedsDataTest() | 31 public void ValidateRegexEmptyNeedsDataTest() |
34 { | 32 { |
35 var parameter = new Parameter { Pattern = ". ", Name = "test" }; | 33 var parameter = new Parameter { Pattern = ". ", Name = "test" }; |
36 Assert.IsFalse(ParameterValidator.ValidateRegex(parameter, "")); | 34 Assert.IsFalse(ParameterValidator.ValidateRegex(parameter, "")); |
37 } | 35 } |
38 | 36 |
39 /// <summary> Tests validate regex. </summary> | 37 /// <summary>Tests validate regex.</summary> |
40 [Test] | 38 [Test] |
41 public void ValidateRegexTest() | 39 public void ValidateRegexTest() |
42 { | 40 { |
43 var parameter = new Parameter { Pattern = ". ", Name = "test" }; | 41 var parameter = new Parameter { Pattern = ". ", Name = "test" }; |
44 Assert.IsTrue(ParameterValidator.ValidateRegex(parameter, "Test")); | 42 Assert.IsTrue(ParameterValidator.ValidateRegex(parameter, "Test")); |
45 } | 43 } |
46 } | 44 } |
47 } | 45 } |
OLD | NEW |