public void TestGetModels_InvalidManufacturer_2013() { var response = ReadAPI.GetModels("hello_bad_manufacturer_name", 2013); Assert.AreEqual(0, response.Count); Assert.IsTrue(response.Message.Contains("successful")); Assert.AreEqual(response.Count, response.MakeModels.Count); }
public void TestGetModels_Ford_2015() { var response = ReadAPI.GetModels("ford", 2015); Assert.IsTrue(response.Count > 0); Assert.IsTrue(response.Message.Contains("successful")); Assert.AreEqual(response.Count, response.MakeModels.Count); }
public void TestGetModels_Honda_2014() { var response = ReadAPI.GetModels("honda", 2014); Assert.IsTrue(response.Count > 0); Assert.IsTrue(response.Message.Contains("successful")); Assert.AreEqual(response.Count, response.MakeModels.Count); }
public void TestGetModels_EmptyManufacturer_2013() { bool caughtException = false; const string ExpectedExceptionMessage = "The parameter for the make cannot be an empty string. (Parameter 'make')"; try { var response = ReadAPI.GetModels(string.Empty, 2013); } catch (ArgumentException ex) { caughtException = true; Assert.AreEqual(ExpectedExceptionMessage, ex.Message); Assert.AreEqual("make", ex.ParamName); } Assert.IsTrue(caughtException); }
public void TestGetModels_Honda_InvalidYear2199() { bool caughtException = false; string expectedExceptionMessage = "The parameter for the year must be between 1879 and " + DateTime.Now.AddYears(1).Year + ". (Parameter 'year')"; try { var response = ReadAPI.GetModels("honda", 2199); } catch (ArgumentException ex) { caughtException = true; Assert.AreEqual(expectedExceptionMessage, ex.Message); Assert.AreEqual("year", ex.ParamName); } Assert.IsTrue(caughtException); }