Skip to content

Commit 09e05a5

Browse files
author
Luke Marlin
committed
1 parent 7dca9de commit 09e05a5

File tree

9 files changed

+13
-31
lines changed

9 files changed

+13
-31
lines changed

csharp-ovh-test-suite/Calls.cs

-9
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,14 @@
33
// See the LICENSE file in the project root for more information.
44

55
using Microsoft.VisualStudio.TestTools.UnitTesting;
6-
using Ovh.Api;
7-
using Ovh.Api.Exceptions;
86
using System;
9-
using System.Collections.Generic;
107
using System.IO;
11-
using System.Linq;
12-
using System.Text;
13-
using System.Threading.Tasks;
148

159
namespace csharp_ovh_test_suite
1610
{
1711
[TestClass]
1812
public class Calls
1913
{
20-
private const string TestKeyName = "testKey";
21-
private const string TestKeyValue = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAYQC1MpRocPluAYqZCLN7/6gRQwWsimrJtQkAAecTKk8MSQrxEJNmvvdfndTtYVhCNxRhbWTevoIKq/FzeTbtDTHucoCxu0kzXAJSr8yPxAlqTql9sKl4pWFyeARj6wrVLP8= [email protected]";
22-
2314
[TestInitialize]
2415
public void CreateConfigFile()
2516
{

csharp-ovh-test-suite/ClientWithConfigFile.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public void ValidConfigFileWithEndpointOnly()
6969
CreateConfigFileWithEndpointOnly();
7070
Client client = new Client();
7171
Assert.AreEqual(client.Endpoint, "https://eu.api.ovh.com/1.0/");
72-
var a = client.TimeDelta;
72+
long a = client.TimeDelta;
7373
}
7474

7575
[TestMethod]
@@ -81,7 +81,7 @@ public void ValidConfigFileWithAllValues()
8181
Assert.AreEqual(client.ApplicationKey, "my_app_key");
8282
Assert.AreEqual(client.ApplicationSecret, "my_application_secret");
8383
Assert.AreEqual(client.ConsumerKey, "my_consumer_key");
84-
var a = client.TimeDelta;
84+
long a = client.TimeDelta;
8585
}
8686
}
8787
}

csharp-ovh-test-suite/ClientWithEnvironmentParams.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public void ValidEndpoint()
4242
{
4343
Client client = new Client();
4444
Assert.AreEqual(client.Endpoint, "https://eu.api.ovh.com/1.0/");
45-
var a = client.TimeDelta;
45+
long a = client.TimeDelta;
4646
}
4747

4848
[TestMethod]
@@ -54,7 +54,7 @@ public void AllParams()
5454
Assert.AreEqual(client.ApplicationKey, "my_app_key");
5555
Assert.AreEqual(client.ApplicationSecret, "my_application_secret");
5656
Assert.AreEqual(client.ConsumerKey, "my_consumer_key");
57-
var a = client.TimeDelta;
57+
long a = client.TimeDelta;
5858
}
5959
}
6060
}

csharp-ovh-test-suite/Properties/AssemblyInfo.cs

+5-5
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
using System.Runtime.CompilerServices;
77
using System.Runtime.InteropServices;
88

9-
// General Information about an assembly is controlled through the following
9+
// General Information about an assembly is controlled through the following
1010
// set of attributes. Change these attribute values to modify the information
1111
// associated with an assembly.
1212
[assembly: AssemblyTitle("csharp-ovh-test-suite")]
@@ -18,8 +18,8 @@
1818
[assembly: AssemblyTrademark("")]
1919
[assembly: AssemblyCulture("")]
2020

21-
// Setting ComVisible to false makes the types in this assembly not visible
22-
// to COM components. If you need to access a type in this assembly from
21+
// Setting ComVisible to false makes the types in this assembly not visible
22+
// to COM components. If you need to access a type in this assembly from
2323
// COM, set the ComVisible attribute to true on that type.
2424
[assembly: ComVisible(false)]
2525

@@ -29,11 +29,11 @@
2929
// Version information for an assembly consists of the following four values:
3030
//
3131
// Major Version
32-
// Minor Version
32+
// Minor Version
3333
// Build Number
3434
// Revision
3535
//
36-
// You can specify all the values or you can default the Build and Revision Numbers
36+
// You can specify all the values or you can default the Build and Revision Numbers
3737
// by using the '*' as shown below:
3838
// [assembly: AssemblyVersion("1.0.*")]
3939
[assembly: AssemblyVersion("1.0.0.0")]

csharp-ovh-test-suite/csharp-ovh-test-suite.csproj

-3
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,6 @@
7070
<Compile Include="Properties\AssemblyInfo.cs" />
7171
</ItemGroup>
7272
<ItemGroup>
73-
<None Include="CallsTest.orderedtest">
74-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
75-
</None>
7673
<None Include="packages.config" />
7774
<None Include="test-suite.playlist" />
7875
</ItemGroup>

csharp-ovh/Client.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
using System;
55
using System.Collections.Generic;
66
using System.Collections.Specialized;
7+
using System.IO;
78
using System.Linq;
89
using System.Net;
910
using System.Net.Cache;
@@ -211,7 +212,6 @@ public string Get(string target, NameValueCollection kwargs = null, bool needAut
211212
return Call("GET", target, null, needAuth);
212213
}
213214

214-
215215
/// <summary>
216216
/// Issues a POST call with an expected return type
217217
/// </summary>
@@ -562,7 +562,7 @@ private void HandleHttpError(HttpWebResponse httpResponse, Exception ex)
562562

563563
private JObject ExtractResponseObject(HttpWebResponse httpResponse)
564564
{
565-
var dataStream = httpResponse.GetResponseStream();
565+
Stream dataStream = httpResponse.GetResponseStream();
566566
int dataLength = (int)dataStream.Length;
567567
byte[] dataBuffer = new byte[dataLength];
568568
dataStream.Read(dataBuffer, 0, dataLength);

csharp-ovh/Config.cs

+1-2
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ public ConfigurationManager(string endpoint, string applicationKey = null,
8888
}
8989
}
9090

91-
9291
/// <summary>
9392
/// Load parameter "name" from configuration, respecting priority order.
9493
/// Most of the time, "section" will correspond to the current api
@@ -110,7 +109,7 @@ public string Get(string section, string name)
110109
return value;
111110
}
112111

113-
var sectionData = Config[section];
112+
KeyDataCollection sectionData = Config[section];
114113
if (sectionData == null)
115114
{
116115
throw new ConfigurationKeyMissingException(

csharp-ovh/Exceptions.cs

-5
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ protected ApiException(
1717
{ }
1818
}
1919

20-
2120
/// <summary>
2221
/// Raised when the request fails at a low level (DNS, network, ...)
2322
/// </summary>
@@ -192,8 +191,6 @@ protected NotGrantedCallException(
192191
{ }
193192
}
194193

195-
196-
197194
[Serializable]
198195
public class NotCredentialException : ApiException
199196
{
@@ -206,7 +203,6 @@ protected NotCredentialException(
206203
{ }
207204
}
208205

209-
210206
[Serializable]
211207
public class ForbiddenException : ApiException
212208
{
@@ -219,7 +215,6 @@ protected ForbiddenException(
219215
{ }
220216
}
221217

222-
223218
[Serializable]
224219
public class ConfigurationKeyMissingException : ApiException
225220
{

csharp-ovh/project.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": "0.9.11-*",
2+
"version": "0.9.12-*",
33
"description": "chsarp-ovh Class Library",
44
"authors": [ "Luke Marlin" ],
55
"tags": [ "" ],

0 commit comments

Comments
 (0)