mirror of
https://github.com/radzenhq/radzen-blazor.git
synced 2026-07-08 18:16:08 +00:00
Add COUNTIF/COUNTIFS, SUMIFS, AVERAGEIF/AVERAGEIFS, MAXIFS/MINIFS, MATCH/XMATCH, CONCATENATE, ABS, MOD, MEDIAN, IFS, SWITCH, POWER, SQRT, PRODUCT, SUMPRODUCT, CEILING, FLOOR, STDEV/STDEVP/VAR/VARP (and .S/.P aliases), MODE (and MODE.SNGL), RANK (and RANK.EQ), COUNTBLANK, IFNA, ISBLANK/ISNUMBER/ISTEXT/ISERROR/ISNA, DAYS, NETWORKDAYS, WORKDAY, DATEVALUE, EXACT, CHAR, CODE. Engine support: ParameterType.Group preserves argument boundaries for variadic range/criteria pairs and arrays; FunctionStore.Add registers dotted-name aliases; the parser accepts dotted function names; CellData comparisons are case-insensitive and MatchesCriteria handles =/<> operators and wildcards. Fixes a latent CHOOSE bug where range arguments were flattened. All function results verified against Excel.
27 lines
630 B
C#
27 lines
630 B
C#
using Xunit;
|
|
|
|
using Radzen.Documents.Spreadsheet;
|
|
namespace Radzen.Blazor.Spreadsheet.Tests;
|
|
|
|
public class ProductFunctionTests
|
|
{
|
|
readonly Worksheet sheet = new(5, 5);
|
|
|
|
[Fact]
|
|
public void ShouldMultiplyValues()
|
|
{
|
|
sheet.Cells["A1"].Formula = "=PRODUCT(2,3,4)";
|
|
Assert.Equal(24d, sheet.Cells["A1"].Value);
|
|
}
|
|
|
|
[Fact]
|
|
public void ShouldIgnoreTextInRange()
|
|
{
|
|
sheet.Cells["A1"].Value = 2;
|
|
sheet.Cells["A2"].Value = "x";
|
|
sheet.Cells["A3"].Value = 5;
|
|
sheet.Cells["B1"].Formula = "=PRODUCT(A1:A3)";
|
|
Assert.Equal(10d, sheet.Cells["B1"].Value);
|
|
}
|
|
}
|