File: default_test.go

package info (click to toggle)
golang-github-go-openapi-strfmt 0.23.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 356 kB
  • sloc: sh: 13; makefile: 2
file content (129 lines) | stat: -rw-r--r-- 3,464 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
package conv

import (
	"testing"

	"github.com/stretchr/testify/assert"

	"github.com/go-openapi/strfmt"
)

func TestBase64Value(t *testing.T) {
	assert.Equal(t, strfmt.Base64(nil), Base64Value(nil))
	base64 := strfmt.Base64([]byte{4, 2})
	assert.Equal(t, base64, Base64Value(&base64))
}

func TestURIValue(t *testing.T) {
	assert.Equal(t, strfmt.URI(""), URIValue(nil))
	value := strfmt.URI("foo")
	assert.Equal(t, value, URIValue(&value))
}

func TestEmailValue(t *testing.T) {
	assert.Equal(t, strfmt.Email(""), EmailValue(nil))
	value := strfmt.Email("foo")
	assert.Equal(t, value, EmailValue(&value))
}

func TestHostnameValue(t *testing.T) {
	assert.Equal(t, strfmt.Hostname(""), HostnameValue(nil))
	value := strfmt.Hostname("foo")
	assert.Equal(t, value, HostnameValue(&value))
}

func TestIPv4Value(t *testing.T) {
	assert.Equal(t, strfmt.IPv4(""), IPv4Value(nil))
	value := strfmt.IPv4("foo")
	assert.Equal(t, value, IPv4Value(&value))
}

func TestIPv6Value(t *testing.T) {
	assert.Equal(t, strfmt.IPv6(""), IPv6Value(nil))
	value := strfmt.IPv6("foo")
	assert.Equal(t, value, IPv6Value(&value))
}

func TestCIDRValue(t *testing.T) {
	assert.Equal(t, strfmt.CIDR(""), CIDRValue(nil))
	value := strfmt.CIDR("foo")
	assert.Equal(t, value, CIDRValue(&value))
}

func TestMACValue(t *testing.T) {
	assert.Equal(t, strfmt.MAC(""), MACValue(nil))
	value := strfmt.MAC("foo")
	assert.Equal(t, value, MACValue(&value))
}

func TestUUIDValue(t *testing.T) {
	assert.Equal(t, strfmt.UUID(""), UUIDValue(nil))
	value := strfmt.UUID("foo")
	assert.Equal(t, value, UUIDValue(&value))
}

func TestUUID3Value(t *testing.T) {
	assert.Equal(t, strfmt.UUID3(""), UUID3Value(nil))
	value := strfmt.UUID3("foo")
	assert.Equal(t, value, UUID3Value(&value))
}

func TestUUID4Value(t *testing.T) {
	assert.Equal(t, strfmt.UUID4(""), UUID4Value(nil))
	value := strfmt.UUID4("foo")
	assert.Equal(t, value, UUID4Value(&value))
}

func TestUUID5Value(t *testing.T) {
	assert.Equal(t, strfmt.UUID5(""), UUID5Value(nil))
	value := strfmt.UUID5("foo")
	assert.Equal(t, value, UUID5Value(&value))
}

func TestISBNValue(t *testing.T) {
	assert.Equal(t, strfmt.ISBN(""), ISBNValue(nil))
	value := strfmt.ISBN("foo")
	assert.Equal(t, value, ISBNValue(&value))
}

func TestISBN10Value(t *testing.T) {
	assert.Equal(t, strfmt.ISBN10(""), ISBN10Value(nil))
	value := strfmt.ISBN10("foo")
	assert.Equal(t, value, ISBN10Value(&value))
}

func TestISBN13Value(t *testing.T) {
	assert.Equal(t, strfmt.ISBN13(""), ISBN13Value(nil))
	value := strfmt.ISBN13("foo")
	assert.Equal(t, value, ISBN13Value(&value))
}

func TestCreditCardValue(t *testing.T) {
	assert.Equal(t, strfmt.CreditCard(""), CreditCardValue(nil))
	value := strfmt.CreditCard("foo")
	assert.Equal(t, value, CreditCardValue(&value))
}

func TestSSNValue(t *testing.T) {
	assert.Equal(t, strfmt.SSN(""), SSNValue(nil))
	value := strfmt.SSN("foo")
	assert.Equal(t, value, SSNValue(&value))
}

func TestHexColorValue(t *testing.T) {
	assert.Equal(t, strfmt.HexColor(""), HexColorValue(nil))
	value := strfmt.HexColor("foo")
	assert.Equal(t, value, HexColorValue(&value))
}

func TestRGBColorValue(t *testing.T) {
	assert.Equal(t, strfmt.RGBColor(""), RGBColorValue(nil))
	value := strfmt.RGBColor("foo")
	assert.Equal(t, value, RGBColorValue(&value))
}

func TestPasswordValue(t *testing.T) {
	assert.Equal(t, strfmt.Password(""), PasswordValue(nil))
	value := strfmt.Password("foo")
	assert.Equal(t, value, PasswordValue(&value))
}