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); }
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); }