public void VariationSendsFeatureEventWithReasonForUnknownFlagWhenClientIsNotInitialized()
        {
            var config = TestUtil.ConfigWithFlagsJson(user, "appkey", "")
                         .UpdateProcessorFactory(MockUpdateProcessorThatNeverInitializes.Factory())
                         .EventProcessor(eventProcessor);

            config.EventProcessor(eventProcessor);

            using (LdClient client = TestUtil.CreateClient(config.Build(), user))
            {
                EvaluationDetail <string> result = client.StringVariationDetail("flag", "b");
                var expectedReason = EvaluationReason.ErrorReason(EvaluationErrorKind.CLIENT_NOT_READY);
                Assert.Equal("b", result.Value);
                Assert.Equal(expectedReason, result.Reason);
                Assert.Collection(eventProcessor.Events,
                                  e => CheckIdentifyEvent(e, user),
                                  e => {
                    FeatureRequestEvent fe = Assert.IsType <FeatureRequestEvent>(e);
                    Assert.Equal("flag", fe.Key);
                    Assert.Equal("b", fe.Value.AsString);
                    Assert.Null(fe.Variation);
                    Assert.Null(fe.Version);
                    Assert.Equal("b", fe.Default.AsString);
                    Assert.False(fe.TrackEvents);
                    Assert.Null(fe.DebugEventsUntilDate);
                    Assert.Equal(expectedReason, fe.Reason);
                });
            }
        }
        public void VariationSendsFeatureEventForUnknownFlagWhenClientIsNotInitialized()
        {
            var config = TestUtil.ConfigWithFlagsJson(user, "appkey", "")
                         .UpdateProcessorFactory(MockUpdateProcessorThatNeverInitializes.Factory())
                         .EventProcessor(eventProcessor);

            config.EventProcessor(eventProcessor);

            using (LdClient client = TestUtil.CreateClient(config.Build(), user))
            {
                string result = client.StringVariation("flag", "b");
                Assert.Equal("b", result);
                Assert.Collection(eventProcessor.Events,
                                  e => CheckIdentifyEvent(e, user),
                                  e =>
                {
                    FeatureRequestEvent fe = Assert.IsType <FeatureRequestEvent>(e);
                    Assert.Equal("flag", fe.Key);
                    Assert.Equal("b", fe.Value.AsString);
                    Assert.Null(fe.Variation);
                    Assert.Null(fe.Version);
                    Assert.Equal("b", fe.Default.AsString);
                    Assert.Null(fe.Reason);
                });
            }
        }