Skip to content

Commit

Permalink
Update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
jobairkhan committed Jan 18, 2018
1 parent 7573c70 commit 333a415
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 12 deletions.
50 changes: 47 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,52 @@ XUnit test Extension.

Added functionalites

1. Trait attributes for Unit, Acceptance and Integration Test.
2. Fact and theory sentence attribute help to add spaces to increase readability.
3. Equality test. Original equality test code is copied from course 'Improving Testability Through Design' by Zoran Horvat; and changed to work with XUnit
1. Subclass of trait attributes to mark tests as Unit, Acceptance and Integration Test.
2. 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).
3. 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

### How to use
Please check the [sample](https://github.com/jobairkhan/Xunit.Extension/tree/master/sample/XUnit.Extension.Sample).


### Example

```C#
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();
}
}
}

```

### Result

![alt testwindow](https://raw.githubusercontent.com/jobairkhan/Xunit.Extension/master/sample/TheorySentence.PNG)


FAQ:
- I have added [FactSentence] but still displaying without spaces

--> *Please close and open the solution*

6 changes: 4 additions & 2 deletions sample/XUnit.Extension.Sample/EqualityTest.cs
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
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)
public void SimpleValueObject_TrimTest(string value1MayContainSpaces, string value2MayContainSpaces)
{
EqualityTests
.For(new SimpleValueObject("first", "second"))
Expand All @@ -19,7 +21,7 @@ public void ValueObject_TrimTest(string value1MayContainSpaces, string value2May
}

[FactSentence]
public void ValueObject_FullTest()
public void SimpleValueObject_FullTest()
{
EqualityTests
.For(new SimpleValueObject("first", "second"))
Expand Down
15 changes: 8 additions & 7 deletions src/Xunit.Extension.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,15 @@
<Authors>M Jobair Khan</Authors>
<Owners>JKhan-BU</Owners>
<Company>CT</Company>
<Description>
<Description>Some extended Xunit based functionalities</Description>
<Summary>
XUnit test Extension and contains
1. Trait attributes for Unit, Acceptance and Integration Test.
2. Fact and theory sentence attribute help to add spaces to increase readability.
3. Equality test. Original equality test code is copied from course 'Improving Testability Through Design' by Zoran Horvat; and changed to work with XUnit
</Description>
</Summary>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
<PackageReleaseNotes>Inital release</PackageReleaseNotes>
<PackageReleaseNotes>Update information</PackageReleaseNotes>
<Copyright>Copyright 2018 (c) M Jobair Khan. All rights reserved.</Copyright>
<PackageTags>Equality;EqualityTests;Xunit;TestExtension;BestUnion;UnitTest;Acceptance;Integration;Trait</PackageTags>
<DelaySign>false</DelaySign>
Expand All @@ -23,13 +24,13 @@
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>jkhan-xunit-extension.snk</AssemblyOriginatorKeyFile>
<AssemblyVersion>1.0.0</AssemblyVersion>
<FileVersion>1.0.0</FileVersion>
<Version>1.0.0</Version>
<AssemblyVersion>1.0.1</AssemblyVersion>
<FileVersion>1.0.1</FileVersion>
<Version>1.0.1</Version>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="xunit" Version="2.3.1" />
<PackageReference Include="xunit" Version="2.3.0" />
</ItemGroup>

</Project>

0 comments on commit 333a415

Please sign in to comment.