Skip to content

Commit

Permalink
Merge pull request #58 from contentstack/fix/DX-1484
Browse files Browse the repository at this point in the history
fix: tests for variants entries
  • Loading branch information
nadeem-cs authored Oct 9, 2024
2 parents d980054 + 42548b2 commit 121e6e1
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
4 changes: 4 additions & 0 deletions Contentstack.Core.Tests/EntryTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ await sourceEntry
else
{
Assert.True(result.Uid == sourceEntry.Uid);
Assert.NotNull(result._variant);
Assert.NotNull(result._variant["_uid"]);
}
});
}
Expand All @@ -120,6 +122,8 @@ await sourceEntry
else
{
Assert.True(result.Uid == sourceEntry.Uid);
Assert.NotNull(result._variant);
Assert.NotNull(result._variant["_uid"]);
}
});
}
Expand Down
18 changes: 17 additions & 1 deletion Contentstack.Core/Models/Entry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ private string _Url

internal Dictionary<string, object> _metadata = new Dictionary<string, object>();
#endregion


#region Public Properties
/// <summary>
/// Title of an entry
Expand Down Expand Up @@ -110,6 +110,22 @@ private string _Url
/// </example>
public Dictionary<string, object> Metadata { get; set; }

/// <summary>
/// Set key/value attributes of an current entry instance.
/// </summary>
/// <example>
/// <code>
/// ContentstackClient stack = new ContentstackClinet(&quot;api_key&quot;, &quot;delivery_token&quot;, &quot;environment&quot;);
/// Entry entry = stack.ContentType(&quot;contentType_id&quot;).Entry(&quot;entry_uid&quot;);
/// entry.Fetch&lt;Product&gt;().ContinueWith((entryResult) =&gt; {
/// //Your callback code.
/// //var result = entryResult.Result.Object;
/// });
/// </code>
/// </example>
public Dictionary<string, object> _variant { get; set; }


/// <summary>
/// Set key/value attributes of an current entry instance.
/// </summary>
Expand Down

0 comments on commit 121e6e1

Please sign in to comment.