add test cases for failing connections on API call tests
This commit is contained in:
parent
95f958c29e
commit
821d9d1ed5
@ -182,6 +182,18 @@ namespace dopt.DeltaBarth.Tests
|
||||
test.Dispose();
|
||||
}
|
||||
[TestMethod]
|
||||
public void Umsatzprognose_WithCompanyIdWithoutDate_Test_FailConnection()
|
||||
{
|
||||
var test = new TPlugin();
|
||||
string apiUrlSet = config.apiUrl, user = config.username, password = config.password, database = config.database, mandant = config.mandant;
|
||||
test.Startup(baseDataPath, apiUrlSet, user, password, database, mandant);
|
||||
var comp_id = 1024;
|
||||
var res = test.Umsatzprognose(comp_id, null);
|
||||
Assert.AreEqual(1, res.status.code);
|
||||
PrettyPrint(res);
|
||||
test.Dispose();
|
||||
}
|
||||
[TestMethod]
|
||||
[TestCategory("ActiveAPI")]
|
||||
public void Umsatzprognose_WithoutCompanyIdWithInvalidDate_Test()
|
||||
{
|
||||
@ -195,6 +207,18 @@ namespace dopt.DeltaBarth.Tests
|
||||
test.Dispose();
|
||||
}
|
||||
[TestMethod]
|
||||
public void Umsatzprognose_WithoutCompanyIdWithInvalidDate_Test_FailConnection()
|
||||
{
|
||||
var test = new TPlugin();
|
||||
string apiUrlSet = config.apiUrl, user = config.username, password = config.password, database = config.database, mandant = config.mandant;
|
||||
test.Startup(baseDataPath, apiUrlSet, user, password, database, mandant);
|
||||
var date = new DateTime(2030, 1, 1, 12, 45, 30);
|
||||
var res = test.Umsatzprognose(null, date);
|
||||
Assert.AreEqual(1, res.status.code);
|
||||
PrettyPrint(res);
|
||||
test.Dispose();
|
||||
}
|
||||
[TestMethod]
|
||||
[TestCategory("ActiveAPI")]
|
||||
public void Umsatzprognose_WithoutCompanyIdWithValidDate_Test()
|
||||
{
|
||||
@ -207,5 +231,17 @@ namespace dopt.DeltaBarth.Tests
|
||||
PrettyPrint(res);
|
||||
test.Dispose();
|
||||
}
|
||||
[TestMethod]
|
||||
public void Umsatzprognose_WithoutCompanyIdWithValidDate_Test_FailConnection()
|
||||
{
|
||||
var test = new TPlugin();
|
||||
string apiUrlSet = config.apiUrl, user = config.username, password = config.password, database = config.database, mandant = config.mandant;
|
||||
test.Startup(baseDataPath, apiUrlSet, user, password, database, mandant);
|
||||
var date = new DateTime(2015, 1, 1, 12, 45, 30);
|
||||
var res = test.Umsatzprognose(null, date);
|
||||
Assert.AreEqual(1, res.status.code);
|
||||
PrettyPrint(res);
|
||||
test.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user