Beispiel #1
0
        public void Date_userValue_is_less()
        {
            var date = DateTime.SpecifyKind(new DateTime(2019, 9, 26), DateTimeKind.Utc);

            CreateGreaterThanCondition(AttributeType.Date, UnixTime.Get(date).ToString());

            var attributes = new[]
            {
                UnlaunchAttribute.NewDate(AttributeKey, date.AddDays(-1))
            };

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

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

            var attributes = new[]
            {
                UnlaunchAttribute.NewDate(AttributeKey, UnixTime.GetUtcDateTime(unixTime).AddDays(-1))
            };

            OnVariationTargetingRulesMatch(attributes);
        }
Beispiel #3
0
        public void Date_userValue_is_greater_unixTime()
        {
            var unixTime = UnixTime.Get();

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

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

            OnVariationTargetingRulesMatch(attributes);
        }
Beispiel #4
0
        public void Date_userValue_is_one_hour_less_which_is_previous_day()
        {
            var date = DateTime.SpecifyKind(new DateTime(2019, 9, 26), DateTimeKind.Utc);

            CreateGreaterThanCondition(AttributeType.Date, UnixTime.Get(date).ToString());

            var attributes = new[]
            {
                UnlaunchAttribute.NewDate(AttributeKey, date.AddHours(1)) // one hour more but still in same day
            };

            OffVariationTargetingRulesNotMatch(attributes);
        }
Beispiel #5
0
        public void Date_userValue_is_the_same_dateTime()
        {
            var date = DateTime.SpecifyKind(new DateTime(2019, 9, 26), DateTimeKind.Utc);

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

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

            OnVariationTargetingRulesMatch(attributes);
        }
Beispiel #6
0
        [Fact] public void Date_userValue_is_the_same_unixTime()
        {
            var unixTime = UnixTime.Get();

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

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

            OnVariationTargetingRulesMatch(attributes);
        }
Beispiel #7
0
        public void Date_userValue_is_greater_unixTime()
        {
            var unixTime = UnixTime.Get();

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

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

            OffVariationTargetingRulesNotMatch(attributes);
        }