Skip to content

Commit

Permalink
Merge pull request #8 from RichLogan/feature/person-updates
Browse files Browse the repository at this point in the history
Add support for Person.FirstName and Person.LastName
  • Loading branch information
RichLogan authored Oct 31, 2016
2 parents 93cf711 + 8f9a366 commit be42e68
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
4 changes: 4 additions & 0 deletions SparkUnity/Assets/Cisco/Spark/Person.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ namespace Cisco.Spark {
public class Person {
public string Id { get; private set;}
public string DisplayName { get; set;}
public string FirstName { get; set;}
public string LastName { get; set;}
public string Avatar { get; set;}
public DateTime Created { get; private set;}
public List<string> Emails { get; set;}
Expand All @@ -22,6 +24,8 @@ public class Person {
Person(Dictionary<string, object> details) {
Id = (string) details ["id"];
DisplayName = (string) details ["displayName"];
FirstName = (string) details ["firstName"];
LastName = (string) details ["lastName"];
Avatar = (string) details["avatar"];
Created = DateTime.Parse ((string) details ["created"]);

Expand Down
10 changes: 10 additions & 0 deletions SparkUnity/Assets/Cisco/Spark/Tests/TestPerson.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,16 @@ void Start() {
Debug.Log("Display name not retrieved correctly");
}

if (person.FirstName != "Rich") {
errorCount++;
Debug.Log("First name not retrieved correctly");
}

if (person.LastName != "Logan") {
errorCount++;
Debug.Log("Last name not retrieved correctly");
}

StartCoroutine (Person.GetPersonDetails (getPersonAgain => {
if (getPersonAgain != null) {
errorCount++;
Expand Down

0 comments on commit be42e68

Please sign in to comment.