Exemple #1
0
        public void DateTime_userValue_is_less()
        {
            var unixTime = UnixTime.Get();

            CreateGreaterThanCondition(AttributeType.DateTime, unixTime.ToString());

            var attributes = new[]
            {
                UnlaunchAttribute.NewDateTime(AttributeKey, UnixTime.GetUtcDateTime(unixTime - 1000))
            };

            OffVariationTargetingRulesNotMatch(attributes);
        }
        public void DateTime_userValue_is_one_second_behind()
        {
            var unixTime = UnixTime.Get();

            CreateNotEqualsCondition(AttributeType.DateTime, unixTime.ToString());

            var attributes = new[]
            {
                UnlaunchAttribute.NewDateTime(AttributeKey, UnixTime.GetUtcDateTime(unixTime - 1000))
            };

            OnVariationTargetingRulesMatch(attributes);
        }
Exemple #3
0
        public void DateTime_userValue_is_greater()
        {
            var date = DateTime.UtcNow;

            CreateLessThanCondition(AttributeType.DateTime, UnixTime.Get(date).ToString());

            var attributes = new[]
            {
                UnlaunchAttribute.NewDateTime(AttributeKey, date.AddSeconds(2))
            };

            OffVariationTargetingRulesNotMatch(attributes);
        }
Exemple #4
0
        public void DateTime_userValue_is_same_dateTime()
        {
            var date = DateTime.UtcNow;

            CreateEqualsCondition(AttributeType.DateTime, UnixTime.Get(date).ToString());

            var attributes = new[]
            {
                UnlaunchAttribute.NewDateTime(AttributeKey, date)
            };

            OnVariationTargetingRulesMatch(attributes);
        }
Exemple #5
0
        public void DateTime_userValue_is_the_same_unixTime()
        {
            var unixTime = UnixTime.Get();

            CreateGteCondition(AttributeType.DateTime, unixTime.ToString());

            var attributes = new[]
            {
                UnlaunchAttribute.NewDateTime(AttributeKey, UnixTime.GetUtcDateTime(unixTime))
            };

            OnVariationTargetingRulesMatch(attributes);
        }
        public void DateTime_userValue_is_greater_unixTime()
        {
            var unixTime = UnixTime.Get();

            CreateLteCondition(AttributeType.DateTime, unixTime.ToString());

            var attributes = new[]
            {
                UnlaunchAttribute.NewDateTime(AttributeKey, unixTime + 1000)
            };

            OffVariationTargetingRulesNotMatch(attributes);
        }
        public void DateTime_userValue_is_greater_dateTime()
        {
            var date = DateTime.SpecifyKind(new DateTime(2019, 9, 26), DateTimeKind.Utc);

            CreateLteCondition(AttributeType.DateTime, UnixTime.Get(date).ToString());

            var attributes = new[]
            {
                UnlaunchAttribute.NewDateTime(AttributeKey, date.AddSeconds(1))
            };

            OffVariationTargetingRulesNotMatch(attributes);
        }