[longomatch] Add a new field to ProjectDescription with the parent Project ID
- From: Andoni Morales Alastruey <amorales src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [longomatch] Add a new field to ProjectDescription with the parent Project ID
- Date: Wed, 18 Mar 2015 14:47:15 +0000 (UTC)
commit dfe71e822742c4d4b22373a85e4d080d8dab851f
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date: Mon Mar 16 19:59:01 2015 +0100
Add a new field to ProjectDescription with the parent Project ID
LongoMatch.Core/Store/Project.cs | 4 ++--
LongoMatch.Core/Store/ProjectDescription.cs | 8 +++++++-
Tests/Core/Store/TestProject.cs | 6 +++++-
3 files changed, 14 insertions(+), 4 deletions(-)
---
diff --git a/LongoMatch.Core/Store/Project.cs b/LongoMatch.Core/Store/Project.cs
index dc85791..20bc4f0 100644
--- a/LongoMatch.Core/Store/Project.cs
+++ b/LongoMatch.Core/Store/Project.cs
@@ -46,7 +46,7 @@ namespace LongoMatch.Core.Store
/// </summary>
///
[Serializable]
- public class Project : IComparable, IIDObject
+ public class Project : IComparable, IStorable
{
ProjectDescription description;
SubstitutionEventType subsType;
@@ -86,7 +86,7 @@ namespace LongoMatch.Core.Store
}
set {
if (value != null) {
- value.ID = ID;
+ value.ProjectID = ID;
}
description = value;
}
diff --git a/LongoMatch.Core/Store/ProjectDescription.cs b/LongoMatch.Core/Store/ProjectDescription.cs
index 65b0543..f036039 100644
--- a/LongoMatch.Core/Store/ProjectDescription.cs
+++ b/LongoMatch.Core/Store/ProjectDescription.cs
@@ -27,12 +27,13 @@ namespace LongoMatch.Core.Store
/// Describes a project in LongoMatch.
/// </summary>
[Serializable]
- public class ProjectDescription : IComparable, IIDObject
+ public class ProjectDescription : IComparable, IStorable
{
DateTime matchDate, lastModified;
public ProjectDescription ()
{
+ ID = Guid.NewGuid ();
MatchDate = LastModified = DateTime.Now;
}
@@ -44,6 +45,11 @@ namespace LongoMatch.Core.Store
set;
}
+ public Guid ProjectID {
+ get;
+ set;
+ }
+
/// <summary>
/// Title of the project
/// </summary>
diff --git a/Tests/Core/Store/TestProject.cs b/Tests/Core/Store/TestProject.cs
index 42d9cd0..4b84901 100644
--- a/Tests/Core/Store/TestProject.cs
+++ b/Tests/Core/Store/TestProject.cs
@@ -75,9 +75,13 @@ namespace Tests.Core.Store
}
[Test ()]
- [Ignore("Not implemented")]
public void TestSetDescription ()
{
+ ProjectDescription pd = new ProjectDescription ();
+ Project p = new Project ();
+ p.Description = pd;
+ Assert.IsNotNull (pd.ID);
+ Assert.AreEqual (p.ID, pd.ProjectID);
}
[Test ()]
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]