-
Notifications
You must be signed in to change notification settings - Fork 78
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 #70 from sergey-tihon/master
Added support of `unique` operator for xUnit, MsTest and MbUnit
- Loading branch information
Showing
12 changed files
with
183 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
namespace FsUnit.Test | ||
open MbUnit.Framework | ||
open FsUnit.MbUnit | ||
open System | ||
|
||
[<TestFixture>] | ||
type ``have unique items list tests`` ()= | ||
[<Test>] member test. | ||
``empty list should be considered as unique`` ()= | ||
[] |> should be unique | ||
|
||
[<Test>] member test. | ||
``empty list should fail to be considered as not unique`` ()= | ||
shouldFail(fun () -> [] |> should not' (be unique)) | ||
|
||
[<Test>] member test. | ||
``one-item list should be considered as unique`` ()= | ||
[1] |> should be unique | ||
|
||
[<Test>] member test. | ||
``one-item list should not fail to be considered as unique`` ()= | ||
shouldFail(fun () -> [1] |> should not' (be unique)) | ||
|
||
[<Test>] member test. | ||
``unique list should be considered as unique`` ()= | ||
[1;2;3] |> should be unique | ||
|
||
[<Test>] member test. | ||
``unique list should fail to be considered unique`` ()= | ||
shouldFail(fun () -> [1;2;3] |> should not' (be unique)) | ||
|
||
[<Test>] member test. | ||
``non-unique list should not be considered unique`` ()= | ||
[1;1;1] |> should not' (be unique) | ||
|
||
[<Test>] member test. | ||
``non-unique list should fail to be considered unique`` ()= | ||
shouldFail(fun () -> [1;1;1] |> should be unique) | ||
|
||
[<Test>] member test. | ||
``non-unique sequence should not be considered unique`` ()= | ||
[1;1] |> List.toSeq |> should not' (be unique) | ||
|
||
[<Test>] member test. | ||
``unique sequence should be considered unique`` ()= | ||
[1;2] |> List.toSeq |> should be unique | ||
|
||
[<Test>] member test. | ||
``non-unique array should not be considered as unique`` ()= | ||
[|1;1|] |> should not' (be unique) | ||
|
||
[<Test>] member test. | ||
``unique array should be considered unique`` ()= | ||
[|1;2|] |> should be unique |
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,54 @@ | ||
namespace FsUnit.Test | ||
open Microsoft.VisualStudio.TestTools.UnitTesting | ||
open FsUnit.MsTest | ||
open NHamcrest.Core | ||
|
||
[<TestClass>] | ||
type ``have unique items list tests`` ()= | ||
[<TestMethod>] member test. | ||
``empty list should be considered as unique`` ()= | ||
[] |> should be unique | ||
|
||
[<TestMethod>] member test. | ||
``empty list should fail to be considered as not unique`` ()= | ||
shouldFail(fun () -> [] |> should not' (be unique)) | ||
|
||
[<TestMethod>] member test. | ||
``one-item list should be considered as unique`` ()= | ||
[1] |> should be unique | ||
|
||
[<TestMethod>] member test. | ||
``one-item list should not fail to be considered as unique`` ()= | ||
shouldFail(fun () -> [1] |> should not' (be unique)) | ||
|
||
[<TestMethod>] member test. | ||
``unique list should be considered as unique`` ()= | ||
[1;2;3] |> should be unique | ||
|
||
[<TestMethod>] member test. | ||
``unique list should fail to be considered unique`` ()= | ||
shouldFail(fun () -> [1;2;3] |> should not' (be unique)) | ||
|
||
[<TestMethod>] member test. | ||
``non-unique list should not be considered unique`` ()= | ||
[1;1;1] |> should not' (be unique) | ||
|
||
[<TestMethod>] member test. | ||
``non-unique list should fail to be considered unique`` ()= | ||
shouldFail(fun () -> [1;1;1] |> should be unique) | ||
|
||
[<TestMethod>] member test. | ||
``non-unique sequence should not be considered unique`` ()= | ||
[1;1] |> List.toSeq |> should not' (be unique) | ||
|
||
[<TestMethod>] member test. | ||
``unique sequence should be considered unique`` ()= | ||
[1;2] |> List.toSeq |> should be unique | ||
|
||
[<TestMethod>] member test. | ||
``non-unique array should not be considered as unique`` ()= | ||
[|1;1|] |> should not' (be unique) | ||
|
||
[<TestMethod>] member test. | ||
``unique array should be considered unique`` ()= | ||
[|1;2|] |> should be unique |
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,52 @@ | ||
namespace FsUnit.Test | ||
open Xunit | ||
open FsUnit.Xunit | ||
|
||
type ``have unique items list tests`` ()= | ||
[<Fact>] member test. | ||
``empty list should be considered as unique`` ()= | ||
[] |> should be unique | ||
|
||
[<Fact>] member test. | ||
``empty list should fail to be considered as not unique`` ()= | ||
shouldFail(fun () -> [] |> should not' (be unique)) | ||
|
||
[<Fact>] member test. | ||
``one-item list should be considered as unique`` ()= | ||
[1] |> should be unique | ||
|
||
[<Fact>] member test. | ||
``one-item list should not fail to be considered as unique`` ()= | ||
shouldFail(fun () -> [1] |> should not' (be unique)) | ||
|
||
[<Fact>] member test. | ||
``unique list should be considered as unique`` ()= | ||
[1;2;3] |> should be unique | ||
|
||
[<Fact>] member test. | ||
``unique list should fail to be considered unique`` ()= | ||
shouldFail(fun () -> [1;2;3] |> should not' (be unique)) | ||
|
||
[<Fact>] member test. | ||
``non-unique list should not be considered unique`` ()= | ||
[1;1;1] |> should not' (be unique) | ||
|
||
[<Fact>] member test. | ||
``non-unique list should fail to be considered unique`` ()= | ||
shouldFail(fun () -> [1;1;1] |> should be unique) | ||
|
||
[<Fact>] member test. | ||
``non-unique sequence should not be considered unique`` ()= | ||
[1;1] |> List.toSeq |> should not' (be unique) | ||
|
||
[<Fact>] member test. | ||
``unique sequence should be considered unique`` ()= | ||
[1;2] |> List.toSeq |> should be unique | ||
|
||
[<Fact>] member test. | ||
``non-unique array should not be considered as unique`` ()= | ||
[|1;1|] |> should not' (be unique) | ||
|
||
[<Fact>] member test. | ||
``unique array should be considered unique`` ()= | ||
[|1;2|] |> should be unique |