format the code so its less crappy looking
This commit is contained in:
@@ -4,58 +4,54 @@ using Untappd.Net.Responses.Actions;
|
||||
|
||||
namespace Untappd.Net.UnitTests.Responses.Actions
|
||||
{
|
||||
[TestFixture]
|
||||
public class TestCheckInAction
|
||||
{
|
||||
[Test]
|
||||
public void TestAccessors()
|
||||
{
|
||||
Assert.Throws<ArgumentNullException>(() => { new CheckIn(string.Empty, "timezone", 1); });
|
||||
Assert.Throws<ArgumentNullException>(() => { new CheckIn("1", string.Empty, 1); });
|
||||
var checkin = new CheckIn("offset", "timezone", 1);
|
||||
Assert.IsNotNullOrEmpty(checkin.RequestMethod.ToString());
|
||||
Assert.Throws<ArgumentOutOfRangeException>(() => { checkin.Rating = -1; });
|
||||
Assert.Throws<ArgumentOutOfRangeException>(() => { checkin.Rating = 6; });
|
||||
Assert.Throws<ArgumentOutOfRangeException>(() => { checkin.Shout = new String('d', 141); });
|
||||
checkin.Rating = 3;
|
||||
Assert.AreEqual(3, checkin.Rating);
|
||||
var t = "tst";
|
||||
checkin.Shout = t;
|
||||
Assert.IsNotNullOrEmpty(checkin.EndPoint);
|
||||
Assert.AreEqual(checkin.Shout, t);
|
||||
}
|
||||
[TestFixture]
|
||||
public class TestCheckInAction
|
||||
{
|
||||
[Test]
|
||||
public void TestAccessors()
|
||||
{
|
||||
Assert.Throws<ArgumentNullException>(() => { new CheckIn(string.Empty, "timezone", 1); });
|
||||
Assert.Throws<ArgumentNullException>(() => { new CheckIn("1", string.Empty, 1); });
|
||||
var checkin = new CheckIn("offset", "timezone", 1);
|
||||
Assert.IsNotNullOrEmpty(checkin.RequestMethod.ToString());
|
||||
Assert.Throws<ArgumentOutOfRangeException>(() => { checkin.Rating = -1; });
|
||||
Assert.Throws<ArgumentOutOfRangeException>(() => { checkin.Rating = 6; });
|
||||
Assert.Throws<ArgumentOutOfRangeException>(() => { checkin.Shout = new String('d', 141); });
|
||||
checkin.Rating = 3;
|
||||
Assert.AreEqual(3, checkin.Rating);
|
||||
var t = "tst";
|
||||
checkin.Shout = t;
|
||||
Assert.IsNotNullOrEmpty(checkin.EndPoint);
|
||||
Assert.AreEqual(checkin.Shout, t);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestDictionaryGeneration()
|
||||
{
|
||||
var checkin = new CheckIn("offset", "timezone", 1);
|
||||
Assert.AreEqual(checkin.BodyParameters["gmt_offset"], "offset");
|
||||
Assert.AreEqual(checkin.BodyParameters["timezone"], "timezone");
|
||||
Assert.AreEqual(checkin.BodyParameters["bid"], 1);
|
||||
[Test]
|
||||
public void TestDictionaryGeneration()
|
||||
{
|
||||
var checkin = new CheckIn("offset", "timezone", 1);
|
||||
Assert.AreEqual(checkin.BodyParameters["gmt_offset"], "offset");
|
||||
Assert.AreEqual(checkin.BodyParameters["timezone"], "timezone");
|
||||
Assert.AreEqual(checkin.BodyParameters["bid"], 1);
|
||||
|
||||
Assert.IsFalse(checkin.BodyParameters.ContainsKey("geolat"));
|
||||
checkin.Geolat = 4;
|
||||
Assert.IsTrue(checkin.BodyParameters.ContainsKey("geolat"));
|
||||
Assert.AreEqual(checkin.BodyParameters["geolat"], 4);
|
||||
Assert.IsFalse(checkin.BodyParameters.ContainsKey("geolat"));
|
||||
checkin.Geolat = 4;
|
||||
Assert.IsTrue(checkin.BodyParameters.ContainsKey("geolat"));
|
||||
Assert.AreEqual(checkin.BodyParameters["geolat"], 4);
|
||||
|
||||
Assert.IsFalse(checkin.BodyParameters.ContainsKey("geolng"));
|
||||
checkin.Geolng = 4;
|
||||
Assert.IsTrue(checkin.BodyParameters.ContainsKey("geolng"));
|
||||
Assert.AreEqual(checkin.BodyParameters["geolng"], 4);
|
||||
Assert.IsFalse(checkin.BodyParameters.ContainsKey("geolng"));
|
||||
checkin.Geolng = 4;
|
||||
Assert.IsTrue(checkin.BodyParameters.ContainsKey("geolng"));
|
||||
Assert.AreEqual(checkin.BodyParameters["geolng"], 4);
|
||||
|
||||
Assert.IsFalse(checkin.BodyParameters.ContainsKey("shout"));
|
||||
checkin.Shout = "shout";
|
||||
Assert.IsTrue(checkin.BodyParameters.ContainsKey("shout"));
|
||||
Assert.AreEqual(checkin.BodyParameters["shout"], "shout");
|
||||
Assert.IsFalse(checkin.BodyParameters.ContainsKey("shout"));
|
||||
checkin.Shout = "shout";
|
||||
Assert.IsTrue(checkin.BodyParameters.ContainsKey("shout"));
|
||||
Assert.AreEqual(checkin.BodyParameters["shout"], "shout");
|
||||
|
||||
Assert.IsFalse(checkin.BodyParameters.ContainsKey("rating"));
|
||||
checkin.Rating = 2;
|
||||
Assert.IsTrue(checkin.BodyParameters.ContainsKey("rating"));
|
||||
Assert.AreEqual(checkin.BodyParameters["rating"], 2);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Assert.IsFalse(checkin.BodyParameters.ContainsKey("rating"));
|
||||
checkin.Rating = 2;
|
||||
Assert.IsTrue(checkin.BodyParameters.ContainsKey("rating"));
|
||||
Assert.AreEqual(checkin.BodyParameters["rating"], 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user