insightly-api
Diff Revisions
15
vs
16
for /trunk/UnitTestInsightly/ProjectTests.cs
|
@@ -10,6 +10,27 @@ |
10 |
10 |
|
{ |
11 |
11 |
|
private const int CRMTrainingProjectId = 884059; |
12 |
12 |
|
|
|
13 |
+ |
private static IApi _api; |
|
14 |
+ |
|
|
15 |
+ |
/// <summary> |
|
16 |
+ |
/// Test class initialise. |
|
17 |
+ |
/// </summary> |
|
18 |
+ |
/// <param name="context">The context.</param> |
|
19 |
+ |
[ClassInitialize] |
|
20 |
+ |
public static void ContactTestsInitialise(TestContext context) |
|
21 |
+ |
{ |
|
22 |
+ |
_api = new InsightlyAPI(APIUser.PLAIN_API_KEY); |
|
23 |
+ |
} |
|
24 |
+ |
|
|
25 |
+ |
/// <summary> |
|
26 |
+ |
/// Test class cleanup. |
|
27 |
+ |
/// </summary> |
|
28 |
+ |
[ClassCleanup] |
|
29 |
+ |
public static void ContactTestsCleanup() |
|
30 |
+ |
{ |
|
31 |
+ |
_api = null; |
|
32 |
+ |
} |
|
33 |
+ |
|
13 |
34 |
|
#region Get |
14 |
35 |
|
|
15 |
36 |
|
/// <summary> |
|
@@ -18,9 +39,7 @@ |
18 |
39 |
|
[TestMethod] |
19 |
40 |
|
public void GetSmithEnterprisesCRMTrainingForCRMProjectId() |
20 |
41 |
|
{ |
21 |
|
- |
IApi api = new InsightlyAPI(APIUser.PLAIN_API_KEY); |
22 |
|
- |
|
23 |
|
- |
var project = api.GetProject(CRMTrainingProjectId); |
|
42 |
+ |
var project = _api.GetProject(CRMTrainingProjectId); |
24 |
43 |
|
|
25 |
44 |
|
Assert.IsNotNull(project); |
26 |
45 |
|
Assert.IsInstanceOfType(project, typeof(Project)); |
|
@@ -33,9 +52,7 @@ |
33 |
52 |
|
[TestMethod] |
34 |
53 |
|
public void GetBasicProjectDetails() |
35 |
54 |
|
{ |
36 |
|
- |
IApi api = new InsightlyAPI(APIUser.PLAIN_API_KEY); |
37 |
|
- |
|
38 |
|
- |
var projects = api.GetProjects(false); |
|
55 |
+ |
var projects = _api.GetProjects(false); |
39 |
56 |
|
|
40 |
57 |
|
Assert.IsTrue(projects.Count > 0); |
41 |
58 |
|
Assert.IsNull(projects[0].LINKS); |