This file contains hidden or 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
scenario "happy path" { | |
given "my user details" { | |
set user { | |
value = { | |
fullName = "John Smith" | |
username = "[email protected]" | |
password = "secret" | |
} | |
} | |
} |
This file contains hidden or 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
description = <<EOF | |
This feature verify that API works as expected | |
EOF | |
includes = [ | |
"includes/database.hcl", | |
"includes/api.hcl", | |
"happyPath.hcl", | |
"signUp-failures.hcl", | |
"signIn-failures.hcl", |
This file contains hidden or 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
func dropCollection { | |
input { | |
arg mongoUri { | |
description = "mongo uri" | |
} | |
arg database { | |
description = "Name of the database" | |
default = "admin" |
This file contains hidden or 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
vars { | |
mediaJson = "application/json" | |
} | |
func signUp { | |
input { | |
arg baseApi { | |
description = "URL base of the API" | |
} | |
arg user { |
This file contains hidden or 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
# scenario-mult.hcl | |
scenario "operation multiplication" { | |
examples = [ | |
{ x = 20, y = 10, multResult= 200}, | |
{ x = -1, y = -2, multResult= 2}, | |
{ x = 5, y = 5, multResult= 25}, | |
{ x = 5, y = 0, multResult= 0}, | |
] | |
given "initialie result" { | |
set result { |
This file contains hidden or 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
# scenario-sub.hcl | |
scenario "operation substract" { | |
examples = [ | |
{ x = 20, y = 10, subResult= 10}, | |
{ x = 10, y = 20, subResult= 10}, | |
{ x = 5, y = 5, subResult= 0}, | |
] | |
when "subtract y to x" { | |
set result { | |
value = x - y |
This file contains hidden or 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
# scenario-sum.hcl | |
scenario "operation add" { | |
when "values are added" { | |
set result { | |
value = x + y | |
} | |
} | |
then "the result of the operation is the expected" { | |
assert { | |
assertion = result==sumResult |
This file contains hidden or 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
# variables-math-operations.hcl | |
x = 46 | |
y = 54 | |
sumResult = 100 | |
subResult = 8 |
This file contains hidden or 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
# feature-math-operations.hcl | |
description = <<EOF | |
This feature is used to demonstrate that both add and subs | |
operations work as expected. | |
EOF | |
input { | |
arg x { | |
default = 10 | |
} | |
arg y { |
This file contains hidden or 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
package advice | |
import ( | |
"bytes" | |
"crypto/md5" | |
"encoding/gob" | |
"encoding/hex" | |
"fmt" | |
"github.com/patrickmn/go-cache" | |
"github.com/wesovilabs/beyond/api" |