Auth Creds with one parameter
This commit is contained in:
@@ -11,13 +11,13 @@ namespace Untappd.Net.UnitTests.Client
|
||||
[ExpectedException(typeof(ArgumentNullException))]
|
||||
public void ExpectException()
|
||||
{
|
||||
var t = new AuthenticatedUntappdCredentials(null, "d", "d");
|
||||
var t = new AuthenticatedUntappdCredentials(null);
|
||||
}
|
||||
[Test]
|
||||
public void ExpectValid()
|
||||
{
|
||||
var token = "awesome";
|
||||
var t = new AuthenticatedUntappdCredentials(token, "d", "d");
|
||||
var t = new AuthenticatedUntappdCredentials(token);
|
||||
Assert.AreEqual(token, "awesome");
|
||||
token = "newString";
|
||||
//Make sure the reference is not copied over
|
||||
|
||||
@@ -29,10 +29,7 @@ namespace Untappd.Net.UnitTests
|
||||
[Ignore]
|
||||
public void GetActualJsonRequest()
|
||||
{
|
||||
var credentials = new AuthenticatedUntappdCredentials(
|
||||
"",
|
||||
"",
|
||||
"");
|
||||
var credentials = new AuthenticatedUntappdCredentials("");
|
||||
|
||||
Dictionary<string, string> parameters = new Dictionary<string, string>();
|
||||
parameters.Add("q", "wild rose");
|
||||
|
||||
@@ -11,8 +11,7 @@ namespace Untappd.Net.Client
|
||||
/// <param name="accessToken"></param>
|
||||
/// <param name="clientId"></param>
|
||||
/// <param name="clientSecret"></param>
|
||||
public AuthenticatedUntappdCredentials(string accessToken, string clientId, string clientSecret)
|
||||
:base(clientId, clientSecret)
|
||||
public AuthenticatedUntappdCredentials(string accessToken)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(accessToken))
|
||||
{
|
||||
|
||||
@@ -7,6 +7,10 @@ namespace Untappd.Net.Client
|
||||
public string ClientId { get; private set; }
|
||||
public string ClientSecret { get; private set; }
|
||||
|
||||
protected UntappdCredentials()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// UnAuthenticated request. Pass your API id and secret
|
||||
/// </summary>
|
||||
|
||||
@@ -28,11 +28,12 @@ namespace Untappd.Net
|
||||
{
|
||||
case JsonToken.StartObject:
|
||||
var instance = (T)serializer.Deserialize(reader, typeof(T));
|
||||
retval = instance;
|
||||
retval = instance;
|
||||
break;
|
||||
case JsonToken.StartArray:
|
||||
reader.Read();
|
||||
retval = new T();
|
||||
reader.Read();
|
||||
retval = new T();
|
||||
break;
|
||||
}
|
||||
|
||||
return retval;
|
||||
|
||||
Reference in New Issue
Block a user