insightly-api
Diff Revisions
14
vs
15
for /trunk/UnitTestInsightly/OrganisationTests.cs
|
@@ -2,6 +2,7 @@ |
2 |
2 |
|
using Microsoft.VisualStudio.TestTools.UnitTesting; |
3 |
3 |
|
using TS.Insightly.API; |
4 |
4 |
|
using TS.Insightly.API.Contract; |
|
5 |
+ |
using TS.Insightly.API.Interface; |
5 |
6 |
|
|
6 |
7 |
|
namespace UnitTestInsightly |
7 |
8 |
|
{ |
|
@@ -22,7 +23,7 @@ |
22 |
23 |
|
[TestMethod] |
23 |
24 |
|
public void GetSmithEnterprisesForCRMOrganisationId() |
24 |
25 |
|
{ |
25 |
|
- |
InsightlyAPI api = new InsightlyAPI(APIUser.PLAIN_API_KEY); |
|
26 |
+ |
IApi api = new InsightlyAPI(APIUser.PLAIN_API_KEY); |
26 |
27 |
|
|
27 |
28 |
|
var organisation = api.GetOrganisation(SmithEnterprisesOrganisationId); |
28 |
29 |
|
|
|
@@ -37,7 +38,7 @@ |
37 |
38 |
|
[TestMethod] |
38 |
39 |
|
public void GetBasicOrganisationDetails() |
39 |
40 |
|
{ |
40 |
|
- |
InsightlyAPI api = new InsightlyAPI(APIUser.PLAIN_API_KEY); |
|
41 |
+ |
IApi api = new InsightlyAPI(APIUser.PLAIN_API_KEY); |
41 |
42 |
|
|
42 |
43 |
|
var orgs = api.GetOrganisations(false); |
43 |
44 |
|
|
|
@@ -51,7 +52,7 @@ |
51 |
52 |
|
[TestMethod] |
52 |
53 |
|
public void GetFullOrganisationDetails() |
53 |
54 |
|
{ |
54 |
|
- |
InsightlyAPI api = new InsightlyAPI(APIUser.PLAIN_API_KEY); |
|
55 |
+ |
IApi api = new InsightlyAPI(APIUser.PLAIN_API_KEY); |
55 |
56 |
|
|
56 |
57 |
|
var orgs = api.GetOrganisations(true); |
57 |
58 |
|
|
|
@@ -65,7 +66,7 @@ |
65 |
66 |
|
[TestMethod] |
66 |
67 |
|
public void GetOrganisationByName() |
67 |
68 |
|
{ |
68 |
|
- |
InsightlyAPI api = new InsightlyAPI(APIUser.PLAIN_API_KEY); |
|
69 |
+ |
IApi api = new InsightlyAPI(APIUser.PLAIN_API_KEY); |
69 |
70 |
|
const string testName = "Smith Enterprises"; |
70 |
71 |
|
|
71 |
72 |
|
var orgs = api.GetOrganisationsForName(testName); |
|
@@ -87,7 +88,7 @@ |
87 |
88 |
|
public void AddBasicOrganisationRecord() |
88 |
89 |
|
{ |
89 |
90 |
|
Organisation addedOrg = null; |
90 |
|
- |
InsightlyAPI api = new InsightlyAPI(APIUser.PLAIN_API_KEY); |
|
91 |
+ |
IApi api = new InsightlyAPI(APIUser.PLAIN_API_KEY); |
91 |
92 |
|
|
92 |
93 |
|
try |
93 |
94 |
|
{ |
|
@@ -122,7 +123,7 @@ |
122 |
123 |
|
/// </summary> |
123 |
124 |
|
/// <param name="api">The API.</param> |
124 |
125 |
|
/// <param name="organisation">The organisation.</param> |
125 |
|
- |
private void DeleteOrganisation(InsightlyAPI api, Organisation organisation) |
|
126 |
+ |
private void DeleteOrganisation(IApi api, Organisation organisation) |
126 |
127 |
|
{ |
127 |
128 |
|
try |
128 |
129 |
|
{ |