-
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.
#28: Synergy.Contracts: Test files rename
Also changed NUnit to XUnit
- Loading branch information
1 parent
0346603
commit 9c7eb0c
Showing
3 changed files
with
80 additions
and
104 deletions.
There are no files selected for viewing
80 changes: 80 additions & 0 deletions
80
Contracts/Synergy.Contracts.Test/Failures/Because/Fail.Because.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,80 @@ | ||
using Synergy.Contracts.Samples.Domain; | ||
using Xunit; | ||
|
||
namespace Synergy.Contracts.Test.Failures.Because; | ||
|
||
public class FailBecauseTest | ||
{ | ||
[Fact] | ||
public void BecauseWith0Arguments() | ||
{ | ||
// ACT | ||
var exception = Fail.Because("Always"); | ||
|
||
// ASSERT | ||
Assert.NotNull(exception); | ||
Assert.Equal("Always", exception.Message); | ||
} | ||
|
||
[Fact] | ||
public void BecauseWith1Argument() | ||
{ | ||
// ACT | ||
// ReSharper disable once HeapView.BoxingAllocation | ||
var exception = Fail.Because("Always {0}", 1); | ||
|
||
// ASSERT | ||
Assert.NotNull(exception); | ||
Assert.Equal("Always 1", exception.Message); | ||
} | ||
|
||
[Fact] | ||
public void BecauseWith2Arguments() | ||
{ | ||
// ACT | ||
// ReSharper disable once HeapView.BoxingAllocation | ||
var exception = Fail.Because("Always {0} {1}", "fails", 1); | ||
|
||
// ASSERT | ||
Assert.NotNull(exception); | ||
Assert.Equal("Always fails 1", exception.Message); | ||
} | ||
|
||
[Fact] | ||
public void BecauseWith3Arguments() | ||
{ | ||
// ACT | ||
// ReSharper disable once HeapView.BoxingAllocation | ||
var exception = Fail.Because("Always {0} {1} {2}", "fails", 1, "times"); | ||
|
||
// ASSERT | ||
Assert.NotNull(exception); | ||
Assert.Equal("Always fails 1 times", exception.Message); | ||
} | ||
|
||
[Fact] | ||
public void BecauseWithNArguments() | ||
{ | ||
// ACT | ||
// ReSharper disable once HeapView.BoxingAllocation | ||
var exception = Fail.Because("Always {0} {1} {2} {3}", "fails", 1, "times", "frequently"); | ||
|
||
// ASSERT | ||
Assert.NotNull(exception); | ||
Assert.Equal("Always fails 1 times frequently", exception.Message); | ||
} | ||
|
||
[Fact] | ||
public void BecauseSample() | ||
{ | ||
// ARRANGE | ||
var contractor = new Contractor(); | ||
|
||
// ACT | ||
var exception = Assert.Throws<DesignByContractViolationException>( | ||
() => contractor.SetPersonName("Marcin", "Celej")); | ||
|
||
// ASSERT | ||
Assert.Equal("Not implemented yet", exception.Message); | ||
} | ||
} |
18 changes: 0 additions & 18 deletions
18
Contracts/Synergy.Contracts.Test/Failures/FailBecauseTest.cs
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.