-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create unit test for GridVisualizationExtensions class
- Loading branch information
1 parent
bc8ff7f
commit 0cdb2f2
Showing
1 changed file
with
62 additions
and
0 deletions.
There are no files selected for viewing
62 changes: 62 additions & 0 deletions
62
....Dom.Tests/Visualizations/Extensions/Visualizations/GridVisualizationExtensionsFixture.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
using Reveal.Sdk.Dom.Visualizations; | ||
using Reveal.Sdk.Dom.Visualizations.Settings; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Drawing.Printing; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using Xunit; | ||
|
||
namespace Reveal.Sdk.Dom.Tests.Visualizations.Extensions.Visualizations | ||
{ | ||
public class GridVisualizationExtensionsFixture | ||
{ | ||
[Fact] | ||
public void ConfigureSettings_Works_NoConditions() | ||
{ | ||
// Arrange | ||
var vs = new GridVisualization(); | ||
var expectedSettings = new GridVisualizationSettings() | ||
{ | ||
DateFieldAlignment = Alignment.Center, | ||
FontSize = FontSize.Large, | ||
IsFirstColumnFixed = false, | ||
IsPagingEnabled = true, | ||
NumericFieldAlignment = Alignment.Left, | ||
PageSize = 5, | ||
SchemaTypeName = "Test Schema Type Name", | ||
Style = new GridVisualizationStyle() | ||
{ | ||
DateAlignment = Alignment.Left, | ||
FixedLeftColumns = false, | ||
NumericAlignment = Alignment.Right, | ||
TextAlignment = Alignment.Right | ||
}, | ||
TextFieldAlignment = Alignment.Right, | ||
VisualizationType = "Test VS Type" | ||
}; | ||
|
||
var action = (GridVisualizationSettings s) => | ||
{ | ||
s.DateFieldAlignment = expectedSettings.DateFieldAlignment; | ||
s.FontSize = expectedSettings.FontSize; | ||
s.IsFirstColumnFixed = expectedSettings.IsFirstColumnFixed; | ||
s.IsPagingEnabled = expectedSettings.IsPagingEnabled; | ||
s.NumericFieldAlignment = expectedSettings.NumericFieldAlignment; | ||
s.PageSize = expectedSettings.PageSize; | ||
s.SchemaTypeName = expectedSettings.SchemaTypeName; | ||
s.Style = expectedSettings.Style; | ||
s.TextFieldAlignment = expectedSettings.TextFieldAlignment; | ||
s.VisualizationType = expectedSettings.VisualizationType; | ||
}; | ||
|
||
// Act | ||
vs.ConfigureSettings(action); | ||
|
||
// Assert | ||
Assert.Equivalent(expectedSettings, vs.Settings); | ||
} | ||
|
||
} | ||
} |