XUnit test Extension.
Added functionalites
- Subclass of trait attributes to mark tests as Unit, Acceptance and Integration Test.
- Subclass of Fact and theory sentence attribute [FactSentence] and [TheorySentence] are added to increase readability. On test explorer, test name will display with spaces and arrow (after test class name).
- Equality test. Original equality test code is copied from the pluralsight course 'Improving Testability Through Design' by Zoran Horvat; and changed to work with XUnit
Please check the sample.
using Xunit;
using Xunit.Extension.Equality;
using Xunit.Extension.TraitAttributes;
namespace XUnit.Extension.Sample
{
[UnitTest]
public class EqualityTest
{
[TheorySentence]
[InlineData("first ", "second")]
[InlineData(" first", " second")]
[InlineData(" first", "second")]
[InlineData("first", "second ")]
public void ValueObject_TrimTest(string value1MayContainSpaces, string value2MayContainSpaces)
{
EqualityTests
.For(new SimpleValueObject("first", "second"))
.EqualTo(new SimpleValueObject(value1MayContainSpaces, value2MayContainSpaces))
.Assert();
}
}
}
FAQ:
- I have added [FactSentence] but still displaying without spaces
--> Please close and open the solution