Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
passing null variation as variable
  • Loading branch information
mnoman09 committed Sep 27, 2020
commit 8183bcc7bc7d0f17b91f22f17fbe44e0bd234d9e
7 changes: 5 additions & 2 deletions OptimizelySDK.Tests/EventTests/EventFactoryTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,9 @@ public void TestCreateImpressionEventReturnsNullWhenSendFlagDecisionsIsFalseAndI
public void TestCreateImpressionEventReturnsNullWhenSendFlagDecisionsIsFalseAndVariationIsNull()
{
Config.SendFlagDecisions = false;
Variation variation = null;
var impressionEvent = UserEventFactory.CreateImpressionEvent(
Config, Config.GetExperimentFromKey("test_experiment"), variation: null, TestUserId, null, "test_experiment", "experiment");
Config, Config.GetExperimentFromKey("test_experiment"), variation, TestUserId, null, "test_experiment", "experiment");
Assert.IsNull(impressionEvent);
}

Expand Down Expand Up @@ -592,7 +593,9 @@ public void TestCreateImpressionEventRemovesInvalidAttributesFromPayloadRollout(
{ "nan", double.NaN },
{ "invalid_num_value", Math.Pow(2, 53) + 2 },
};
var impressionEvent = UserEventFactory.CreateImpressionEvent(Config, null, variation: null, TestUserId, userAttributes, "test_feature", "rollout");
Variation variation = null;

var impressionEvent = UserEventFactory.CreateImpressionEvent(Config, null, variation, TestUserId, userAttributes, "test_feature", "rollout");
var logEvent = EventFactory.CreateLogEvent(impressionEvent, Logger);

TestData.ChangeGUIDAndTimeStamp(expectedLogEvent.Params, impressionEvent.Timestamp, Guid.Parse(impressionEvent.UUID));
Expand Down