Beispiel #1
0
        public void RemoveKeyNotPresentShouldLEaveFilterUnchanged()
        {
            var filter = new MbedCloudSDK.Common.Filter.Filter();

            filter.Add("key", "value", FilterOperator.Equals);
            filter.Add("error", "found", FilterOperator.NotEqual);
            filter.Add("range", new FilterAttribute("10", FilterOperator.LessOrEqual), new FilterAttribute("2", FilterOperator.GreaterOrEqual));
            filter.Remove("rubbish");
            Assert.AreEqual("key=value&error__neq=found&range__lte=10&range__gte=2", filter.FilterString);
        }
Beispiel #2
0
        public void RemoveShouldRemoveKeyFromFilter()
        {
            var filter = new MbedCloudSDK.Common.Filter.Filter();

            filter.Add("key", "value", FilterOperator.Equals);
            filter.Add("error", "found", FilterOperator.NotEqual);
            filter.Add("range", new FilterAttribute("10", FilterOperator.LessOrEqual), new FilterAttribute("2", FilterOperator.GreaterOrEqual));
            filter.Remove("range");
            Assert.AreEqual("key=value&error__neq=found", filter.FilterString);
        }