-
Notifications
You must be signed in to change notification settings - Fork 2
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 #62 from nfdi4plants/feature-turnUriToTanOnCreatio…
…n-#61 URI 2 TAN on creation
- Loading branch information
Showing
4 changed files
with
121 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
namespace CvTermTests | ||
|
||
|
||
open ControlledVocabulary | ||
open ReferenceObjects | ||
|
||
open Xunit | ||
|
||
|
||
module CheckForUri = | ||
|
||
[<Fact>] | ||
let ``correct check, actual URL 1`` () = | ||
let check = CvTerm.checkForUri testAccession3 | ||
Assert.True check | ||
|
||
[<Fact>] | ||
let ``correct check, actual URL 2`` () = | ||
let check = CvTerm.checkForUri "https://purl.org/TO_00000003" | ||
Assert.True check | ||
|
||
[<Fact>] | ||
let ``correct check, no URL`` () = | ||
let check = CvTerm.checkForUri "purl/123_abc" | ||
Assert.False check | ||
|
||
|
||
module UriToTan = | ||
|
||
[<Fact>] | ||
let ``correct TAN returned`` () = | ||
let expected = "TO:00000003" | ||
let actual = CvTerm.uriToTan testAccession3 | ||
Assert.Equal(expected, actual) | ||
|
||
|
||
module Create = | ||
|
||
[<Fact>] | ||
let ``correct CvTerm, primary create function overload`` () = | ||
let expected = testTerm1 | ||
let actual = CvTerm.create(testAccession1, testName1, testRef1) | ||
Assert.Equal(expected, actual) | ||
|
||
[<Fact>] | ||
let ``correct CvTerm, secondary create function overload (only name given)`` () = | ||
let expected = testTerm4 | ||
let actual = CvTerm.create(testName2) | ||
Assert.Equal(expected, actual) | ||
|
||
[<Fact>] | ||
let ``correct CvTerm, create function with URL as accession`` () = | ||
let expected = testTerm3 | ||
let actual = CvTerm.create(testAccession3, testName2, testRef2) | ||
Assert.Equal(expected, actual) |
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