-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGridApplyFilter.cs
32 lines (31 loc) · 1.23 KB
/
GridApplyFilter.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
using Bunit;
using DxTestProject.Pages;
using System;
using Xunit;
using Microsoft.Extensions.DependencyInjection;
using DevExpress.Blazor;
namespace DevExpressBunit.Test {
public class GridApplyFilter : IDisposable {
public TestContext Context { get; }
public GridApplyFilter() {
Context = new TestContext();
Context.Services.AddOptions();
Context.AddDevExpressBlazorTesting();
}
[Fact]
public void CheckIfNodeClickAppliesFilter() {
var cut = Context.RenderComponent<Grid_ApplyFilter>();
var treeview = cut.FindComponent<DxTreeView>().Instance;
var grid = cut.FindComponent<DxGrid>().Instance;
cut.InvokeAsync(() => treeview.SelectNode(x => x.Text == "Filter by date"));
Assert.Equal(1, grid.GetVisibleRowCount());
cut.InvokeAsync(() => treeview.SelectNode(x => x.Text == "Filter by temperature"));
Assert.Equal(3, grid.GetVisibleRowCount());
cut.InvokeAsync(() => treeview.SelectNode(x => x.Text == "Filter by precipitation"));
Assert.Equal(6, grid.GetVisibleRowCount());
}
public void Dispose() {
Context.Dispose();
}
}
}