Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1)

Delta Between Two Patch Sets: Src/GoogleApis.Tests/Apis/Utils/ExponentialBackOffTest.cs

Issue 13412046: Reimplement OAuth2 library - Step 1 (Closed) Base URL: https://google-api-dotnet-client.googlecode.com/hg/
Left Patch Set: Class comments Created 10 years, 10 months ago
Right Patch Set: minor Created 10 years, 10 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « Src/GoogleApis.Tests/Apis/Services/BaseClientServiceTest.cs ('k') | Src/GoogleApis.Tests/GoogleApis.Tests.csproj » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 /* 1 /*
2 Copyright 2013 Google Inc 2 Copyright 2013 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
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 backOff.GetNextBackOff(-2); 46 backOff.GetNextBackOff(-2);
47 Assert.Fail(); 47 Assert.Fail();
48 } 48 }
49 catch (ArgumentOutOfRangeException) { } 49 catch (ArgumentOutOfRangeException) { }
50 } 50 }
51 51
52 /// <summary>Tests constructor with invalid time span object (less then 0 or greater than 1sec).</summary> 52 /// <summary>Tests constructor with invalid time span object (less then 0 or greater than 1sec).</summary>
53 [Test] 53 [Test]
54 public void Constructor_InvalidValue() 54 public void Constructor_InvalidValue()
55 { 55 {
56 // invalid delta 56 // Invalid delta.
57 SubtestConstructor_InvalidValue(TimeSpan.FromMilliseconds(-1)); 57 SubtestConstructor_InvalidValue(TimeSpan.FromMilliseconds(-1));
58 SubtestConstructor_InvalidValue(TimeSpan.FromDays(-1)); 58 SubtestConstructor_InvalidValue(TimeSpan.FromDays(-1));
59 SubtestConstructor_InvalidValue(TimeSpan.FromMilliseconds(1001)); 59 SubtestConstructor_InvalidValue(TimeSpan.FromMilliseconds(1001));
60 // invalid max 60 // Invalid max.
61 SubtestConstructor_InvalidValue(TimeSpan.FromMilliseconds(500), -1); 61 SubtestConstructor_InvalidValue(TimeSpan.FromMilliseconds(500), -1);
62 SubtestConstructor_InvalidValue(TimeSpan.FromMilliseconds(500), 21); 62 SubtestConstructor_InvalidValue(TimeSpan.FromMilliseconds(500), 21);
63 63
64 } 64 }
65 65
66 /// <summary>A helper subtest to test invalid value given to the constru ctor.</summary> 66 /// <summary>A helper subtest to test invalid value given to the constru ctor.</summary>
67 private void SubtestConstructor_InvalidValue(TimeSpan ts, int max = 10) 67 private void SubtestConstructor_InvalidValue(TimeSpan ts, int max = 10)
68 { 68 {
69 try 69 try
70 { 70 {
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 Assert.AreNotEqual(TimeSpan.MinValue, backOff.GetNextBackOff (i)); 134 Assert.AreNotEqual(TimeSpan.MinValue, backOff.GetNextBackOff (i));
135 } 135 }
136 else 136 else
137 { 137 {
138 Assert.AreEqual(TimeSpan.MinValue, backOff.GetNextBackOff(i) ); 138 Assert.AreEqual(TimeSpan.MinValue, backOff.GetNextBackOff(i) );
139 } 139 }
140 } 140 }
141 } 141 }
142 } 142 }
143 } 143 }
LEFTRIGHT

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b