Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions QueryKit.UnitTests/ArithmeticOperatorTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ public class ArithmeticOperatorTests
[InlineData("%", "%")]
public void from_symbol_returns_the_operator_for_the_symbol(string symbol, string expectedSymbol)
{
#pragma warning disable CS0618 // FromSymbol stays for v1.14.2 compatibility
var op = ArithmeticOperator.FromSymbol(symbol);
#pragma warning restore CS0618

op.Should().NotBeNull();
op!.Symbol.Should().Be(expectedSymbol);
Expand All @@ -22,7 +24,9 @@ public void from_symbol_returns_the_operator_for_the_symbol(string symbol, strin
[Fact]
public void from_symbol_returns_null_for_an_unknown_symbol()
{
#pragma warning disable CS0618 // FromSymbol stays for v1.14.2 compatibility
var op = ArithmeticOperator.FromSymbol("^");
#pragma warning restore CS0618

op.Should().BeNull();
}
Expand Down
1 change: 1 addition & 0 deletions QueryKit/Operators/ArithmeticOperator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ protected ArithmeticOperator(string symbol, int precedence)
public static ArithmeticOperator Divide => new DivideOperator();
public static ArithmeticOperator Modulo => new ModuloOperator();

[Obsolete("QueryKit does not use FromSymbol. The next major version removes it.")]
public static ArithmeticOperator? FromSymbol(string symbol) => symbol switch
{
"+" => Add,
Expand Down
Loading