forked from dotnet/runtime
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request dotnet/corefx#20934 from hughbe/componentmodel-ann…
…otations-tests Add System.ComponentModel.Annotations tests Commit migrated from dotnet/corefx@1a76f61
- Loading branch information
Showing
12 changed files
with
185 additions
and
44 deletions.
There are no files selected for viewing
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
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
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
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
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
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
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
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
47 changes: 47 additions & 0 deletions
47
src/libraries/System.ComponentModel.Annotations/tests/DisplayColumnAttributeTests.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,47 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information. | ||
|
||
using Xunit; | ||
|
||
namespace System.ComponentModel.DataAnnotations.Tests | ||
{ | ||
public class DisplayColumnAttributeTests | ||
{ | ||
[Theory] | ||
[InlineData(null)] | ||
[InlineData("")] | ||
[InlineData("DisplayColumn")] | ||
public void Ctor_DisplayColumn(string displayColumn) | ||
{ | ||
var attribute = new DisplayColumnAttribute(displayColumn); | ||
Assert.Equal(displayColumn, attribute.DisplayColumn); | ||
Assert.Null(attribute.SortColumn); | ||
Assert.False(attribute.SortDescending); | ||
} | ||
|
||
[Theory] | ||
[InlineData(null, null)] | ||
[InlineData("", "")] | ||
[InlineData("DisplayColumn", "SortColumn")] | ||
public void Ctor_DisplayColumn_SortColumn(string displayColumn, string sortColumn) | ||
{ | ||
var attribute = new DisplayColumnAttribute(displayColumn, sortColumn); | ||
Assert.Equal(displayColumn, attribute.DisplayColumn); | ||
Assert.Equal(sortColumn, attribute.SortColumn); | ||
Assert.False(attribute.SortDescending); | ||
} | ||
|
||
[Theory] | ||
[InlineData(null, null, false)] | ||
[InlineData("", "", false)] | ||
[InlineData("DisplayColumn", "SortColumn", true)] | ||
public void Ctor_DisplayColumn_SortColumn_SortDescending(string displayColumn, string sortColumn, bool sortDescending) | ||
{ | ||
var attribute = new DisplayColumnAttribute(displayColumn, sortColumn, sortDescending); | ||
Assert.Equal(displayColumn, attribute.DisplayColumn); | ||
Assert.Equal(sortColumn, attribute.SortColumn); | ||
Assert.Equal(sortDescending, attribute.SortDescending); | ||
} | ||
} | ||
} |
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
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
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