Skip to content

Commit

Permalink
Add Tests to fix FamilySearch#43 and FamilySearch#48
Browse files Browse the repository at this point in the history
  • Loading branch information
JoergHoffmannatGitHub committed Jan 6, 2023
1 parent 23de680 commit a30a8b1
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
18 changes: 18 additions & 0 deletions Gedcomx.Model/Collections/Emails.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
using System.Collections.Generic;

using Gx.Common;

namespace Gx.Model.Collections
{
/// <summary>
/// A list of reference to Emails resources.
/// </summary>
public class Emails : List<ResourceReference>
{
/// <summary>
/// Add an email.
/// </summary>
/// <param name="email">The address to add.</param>
public void Add(string email) => this.Add(new ResourceReference("mailto:" + email));
}
}
24 changes: 24 additions & 0 deletions Gedcomx.Model/Collections/TextValues.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using System.Collections.Generic;
using System.Linq;

using Gx.Common;

namespace Gx.Model.Collections
{
/// <summary>
/// A list of text values.
/// </summary>
public class TextValues : List<TextValue>
{
/// <summary>
/// Add a name.
/// </summary>
/// <param name="name">The name.</param>
public void Add(string name) => Add(new TextValue(name));

/// <summary>
/// Check if List<TextValue> is filled:
/// </summary>
public bool Safe { get { return !(this?.Any() ?? false); } }
}
}

0 comments on commit a30a8b1

Please sign in to comment.