Subversion Repository Public Repository

insightly-api

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
´╗┐using System;
using System.Globalization;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using TS.Insightly.API;
using TS.Insightly.API.Contract;

namespace UnitTestInsightly
{
    [TestClass]
    public class ProjectTests
    {
        private const int CRMTrainingProjectId = 884059;

        #region Get

        /// <summary>
        /// Test returns project record smith enterprises crm training for CRM project unique identifier.
        /// </summary>
        [TestMethod]
        public void GetSmithEnterprisesCRMTrainingForCRMProjectId()
        {
            InsightlyAPI api = new InsightlyAPI(APIUser.PLAIN_API_KEY);

            var project = api.GetProject(CRMTrainingProjectId);

            Assert.IsNotNull(project);
            Assert.IsInstanceOfType(project, typeof(Project));
            Assert.AreEqual(CRMTrainingProjectId, project.PROJECT_ID);
        }

        /// <summary>
        /// Test getting the basic project details.
        /// </summary>
        [TestMethod]
        public void GetBasicProjectDetails()
        {
            InsightlyAPI api = new InsightlyAPI(APIUser.PLAIN_API_KEY);

            var projects = api.GetProjects(false);

            Assert.IsTrue(projects.Count > 0);
            Assert.IsNull(projects[0].LINKS);
        }

        #endregion Get

        #region Post

        #endregion Post

        #region Put


        #endregion Put

        #region Delete

        #endregion Delete
    }
}

Commits for insightly-api/trunk/UnitTestInsightly/ProjectTests.cs

Diff revisions: vs.
Revision Author Commited Message
14 HadleyHope picture HadleyHope Mon 30 Sep, 2013 15:36:43 +0000

Refactor unit tests.
Refactor API use get method to return REST client.