public void PassesFilter_WithIntAndMethod_ReturnsTrue(int toTest, IntFilter.IntFilterMethods method, bool expected) { var filter = new IntFilter(method, 10); var result = filter.PassesFilter(toTest); Assert.Equal(expected, result); }
public void PassesFilter_WithValidStringAndMethod_ReturnsTrue() { var filter = new IntFilter(IntFilter.IntFilterMethods.Greater, 10); var result = filter.PassesFilter("20"); Assert.True(result); }
public void PassesFilter_WithNonInt_ThrowArgumentException() { var filter = new IntFilter(IntFilter.IntFilterMethods.Equal, 10); Assert.Throws <ArgumentException>(() => filter.PassesFilter(new object())); }
public void PassesFilter_WithInvalidStringAndMethod_ThrowsFormatException() { var filter = new IntFilter(IntFilter.IntFilterMethods.Greater, 10); Assert.Throws <FormatException>(() => filter.PassesFilter("not_a_number")); }
public void PassesFilter_WithIntAndNullMethod_ThrowsInvalidOperationException() { var filter = new IntFilter(); Assert.Throws <InvalidOperationException>(() => filter.PassesFilter(10)); }