-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added showcase unit test for [Any] Attribute
This attribute, just like [Random] is not supported yet by VS Test Runner, but Mighty Moose and NUnit GUI Runner handle it just fine.
- Loading branch information
1 parent
1315ef6
commit c0d3580
Showing
3 changed files
with
45 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
using NUnit.Framework; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using TddEbook.TddToolkit; | ||
using TddEbook.TddToolkit.NUnitExtensions; | ||
|
||
namespace TddToolkitSpecification | ||
{ | ||
public class AnyAttributeSpecification | ||
{ | ||
[Test] | ||
public void ShouldAllowPassingDifferentObjectsAndPrimitivesThroughParameters | ||
( | ||
[Any] int anInt, | ||
[Any] int anInt2, | ||
[Any] string aString, | ||
[Any] AnySpecification.ISimple interfaceImplementation, | ||
[Any] IEnumerable<int> anEnumerable, | ||
[Any] List<string> concreteList, | ||
[Any] IEnumerable<AnySpecification.ISimple> interfaceImplementationList, | ||
[Any] ProperValueType value | ||
) | ||
{ | ||
XAssert.NotEqual(default(int), anInt); | ||
XAssert.NotEqual(anInt2, anInt); | ||
Assert.False(string.IsNullOrEmpty(aString)); | ||
Assert.NotNull(interfaceImplementation); | ||
Assert.Greater(anEnumerable.Count(), 0); | ||
Assert.Greater(concreteList.Count(), 0); | ||
Assert.Greater(concreteList.Count(), 0); | ||
|
||
Assert.Greater(interfaceImplementationList.Count(), 0); | ||
Assert.NotNull(interfaceImplementationList.ToArray()[0]); | ||
Assert.NotNull(interfaceImplementationList.ToArray()[1]); | ||
Assert.NotNull(interfaceImplementationList.ToArray()[2]); | ||
|
||
Assert.NotNull(value); | ||
} | ||
|
||
} | ||
} |
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