Skip to content

Commit 425f220

Browse files
committed
Variable Updates
1 parent 33218d8 commit 425f220

File tree

2 files changed

+17
-17
lines changed

2 files changed

+17
-17
lines changed

Contentstack.Core.Tests/ContentstackClientTest.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public void SetEntryUid_SetsValue_WhenNonEmpty()
4242
{
4343
var client = CreateClient();
4444
client.SetEntryUid("entry123");
45-
Assert.Equal("entry123", GetPrivateField(client, "lastEntryUid"));
45+
Assert.Equal("entry123", GetPrivateField(client, "currentEntryUid"));
4646
}
4747

4848
[Fact]
@@ -51,7 +51,7 @@ public void SetEntryUid_DoesNotSet_WhenEmpty()
5151
var client = CreateClient();
5252
client.SetEntryUid("entry123");
5353
client.SetEntryUid("");
54-
Assert.Equal("entry123", GetPrivateField(client, "lastEntryUid"));
54+
Assert.Equal("entry123", GetPrivateField(client, "currentEntryUid"));
5555
}
5656

5757
[Fact]
@@ -60,15 +60,15 @@ public void SetEntryUid_DoesNotSet_WhenNull()
6060
var client = CreateClient();
6161
client.SetEntryUid("entry123");
6262
client.SetEntryUid(null);
63-
Assert.Equal("entry123", GetPrivateField(client, "lastEntryUid"));
63+
Assert.Equal("entry123", GetPrivateField(client, "currentEntryUid"));
6464
}
6565

6666
[Fact]
67-
public void ContentType_SetsLastContentTypeUid_WhenNonEmpty()
67+
public void ContentType_SetscurrentContenttypeUid_WhenNonEmpty()
6868
{
6969
var client = CreateClient();
7070
client.ContentType("blog");
71-
Assert.Equal("blog", GetPrivateField(client, "lastContentTypeUid"));
71+
Assert.Equal("blog", GetPrivateField(client, "currentContenttypeUid"));
7272
}
7373

7474
[Fact]
@@ -77,7 +77,7 @@ public void ContentType_DoesNotSet_WhenEmpty()
7777
var client = CreateClient();
7878
client.ContentType("blog");
7979
client.ContentType("");
80-
Assert.Equal("blog", GetPrivateField(client, "lastContentTypeUid"));
80+
Assert.Equal("blog", GetPrivateField(client, "currentContenttypeUid"));
8181
}
8282

8383
[Fact]
@@ -86,7 +86,7 @@ public void ContentType_DoesNotSet_WhenNull()
8686
var client = CreateClient();
8787
client.ContentType("blog");
8888
client.ContentType(null);
89-
Assert.Equal("blog", GetPrivateField(client, "lastContentTypeUid"));
89+
Assert.Equal("blog", GetPrivateField(client, "currentContenttypeUid"));
9090
}
9191

9292
[Fact]
@@ -208,8 +208,8 @@ public async Task LivePreviewQueryAsync_SetsLivePreviewConfigFields()
208208
// we only test the config fields are set correctly before the call
209209
await client.LivePreviewQueryAsync(query);
210210
var v = client.GetLivePreviewConfig();
211-
Assert.Equal("ctuid", GetPrivateField(client, "lastContentTypeUid"));
212-
Assert.Equal("euid", GetPrivateField(client, "lastEntryUid"));
211+
Assert.Equal("ctuid", GetPrivateField(client, "currentContenttypeUid"));
212+
Assert.Equal("euid", GetPrivateField(client, "currentEntryUid"));
213213
Assert.Equal(true, v.Enable );
214214
Assert.Equal("rid", v.ReleaseId);
215215
Assert.Equal("ts", v.PreviewTimestamp);

Contentstack.Core/ContentstackClient.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ private string _Url
5858
private Dictionary<string, object> _StackHeaders = new Dictionary<string, object>();
5959

6060
// This is used to store the last content type UID for live preview
61-
private string lastContentTypeUid = null;
62-
private string lastEntryUid = null;
61+
private string currentContenttypeUid = null;
62+
private string currentEntryUid = null;
6363
public List<IContentstackPlugin> Plugins { get; set; } = new List<IContentstackPlugin>();
6464
/// <summary>
6565
/// Initializes a instance of the <see cref="ContentstackClient"/> class.
@@ -403,7 +403,7 @@ public void SetEntryUid(string entryUid)
403403
{
404404
if (!string.IsNullOrEmpty(entryUid))
405405
{
406-
this.lastEntryUid = entryUid;
406+
this.currentEntryUid = entryUid;
407407
}
408408
}
409409
/// <summary>
@@ -421,7 +421,7 @@ public ContentType ContentType(String contentTypeName)
421421
{
422422
if (!string.IsNullOrEmpty(contentTypeName))
423423
{
424-
this.lastContentTypeUid = contentTypeName;
424+
this.currentContenttypeUid = contentTypeName;
425425
}
426426
ContentType contentType = new ContentType(contentTypeName);
427427
contentType.SetStackInstance(this);
@@ -619,9 +619,9 @@ public async Task LivePreviewQueryAsync(Dictionary<string, string> query)
619619
query.TryGetValue("content_type_uid", out contentTypeUID);
620620
this.LivePreviewConfig.ContentTypeUID = contentTypeUID;
621621
}
622-
else if (!string.IsNullOrEmpty(this.lastContentTypeUid))
622+
else if (!string.IsNullOrEmpty(this.currentContenttypeUid))
623623
{
624-
this.LivePreviewConfig.ContentTypeUID = this.lastContentTypeUid;
624+
this.LivePreviewConfig.ContentTypeUID = this.currentContenttypeUid;
625625
}
626626

627627

@@ -631,9 +631,9 @@ public async Task LivePreviewQueryAsync(Dictionary<string, string> query)
631631
query.TryGetValue("entry_uid", out entryUID);
632632
this.LivePreviewConfig.EntryUID = entryUID;
633633
}
634-
else if (!string.IsNullOrEmpty(this.lastEntryUid))
634+
else if (!string.IsNullOrEmpty(this.currentEntryUid))
635635
{
636-
this.LivePreviewConfig.EntryUID = this.lastEntryUid;
636+
this.LivePreviewConfig.EntryUID = this.currentEntryUid;
637637
}
638638

639639

0 commit comments

Comments
 (0)