Skip to content

Commit ea260bf

Browse files
refactor(audience-sample): use EventPropertyKeys for typed-event field lookups in live-fire tests
SampleAppLiveFireTests filled the Resource, Purchase, and MilestoneReached typed-event forms by looking up TextFields with inline property-name strings ("currency", "amount", "value", "name"). The SDK already centralises these as EventPropertyKeys.Currency / .Amount / .Value / .Name, made visible to the sample-app tests through the existing InternalsVisibleTo grant. Reference EventPropertyKeys.X from the five lookup sites instead of re-typing the wire-format strings. Discovered during the sample-app demo property-key centralisation pass; kept separate because these keys belong to the SDK's typed-event surface, not the sample-app demo catalogue. Per the user's "everything random goes in a constant" stance. Follow-up to SDK-272 (centralisation of duplicated literals).
1 parent 6b62b58 commit ea260bf

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

examples/audience/Assets/SampleApp/Tests/Runtime/SampleAppLiveFireTests.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,8 @@ public IEnumerator TypedEvent_Resource_FlushReportsOk()
152152
{
153153
yield return DriveTypedEventAndFlush(SampleAppUi.Buttons.TypedEvent(EventNames.Resource), root =>
154154
{
155-
root.Q<TextField>(SampleAppUi.TypedEventField(EventNames.Resource, "currency")).value = "GOLD";
156-
root.Q<TextField>(SampleAppUi.TypedEventField(EventNames.Resource, "amount")).value = "100";
155+
root.Q<TextField>(SampleAppUi.TypedEventField(EventNames.Resource, EventPropertyKeys.Currency)).value = "GOLD";
156+
root.Q<TextField>(SampleAppUi.TypedEventField(EventNames.Resource, EventPropertyKeys.Amount)).value = "100";
157157
});
158158
}
159159

@@ -162,8 +162,8 @@ public IEnumerator TypedEvent_Purchase_FlushReportsOk()
162162
{
163163
yield return DriveTypedEventAndFlush(SampleAppUi.Buttons.TypedEvent(EventNames.Purchase), root =>
164164
{
165-
root.Q<TextField>(SampleAppUi.TypedEventField(EventNames.Purchase, "currency")).value = "USD";
166-
root.Q<TextField>(SampleAppUi.TypedEventField(EventNames.Purchase, "value")).value = "9.99";
165+
root.Q<TextField>(SampleAppUi.TypedEventField(EventNames.Purchase, EventPropertyKeys.Currency)).value = "USD";
166+
root.Q<TextField>(SampleAppUi.TypedEventField(EventNames.Purchase, EventPropertyKeys.Value)).value = "9.99";
167167
});
168168
}
169169

@@ -172,7 +172,7 @@ public IEnumerator TypedEvent_MilestoneReached_FlushReportsOk()
172172
{
173173
yield return DriveTypedEventAndFlush(SampleAppUi.Buttons.TypedEvent(EventNames.MilestoneReached), root =>
174174
{
175-
root.Q<TextField>(SampleAppUi.TypedEventField(EventNames.MilestoneReached, "name")).value = "il2cpp_smoke";
175+
root.Q<TextField>(SampleAppUi.TypedEventField(EventNames.MilestoneReached, EventPropertyKeys.Name)).value = "il2cpp_smoke";
176176
});
177177
}
178178

0 commit comments

Comments
 (0)