Tizen_4.0 base
[platform/upstream/docker-engine.git] / vendor / github.com / stretchr / testify / assert / assertion_forward.go
1 /*
2 * CODE GENERATED AUTOMATICALLY WITH github.com/stretchr/testify/_codegen
3 * THIS FILE MUST NOT BE EDITED BY HAND
4  */
5
6 package assert
7
8 import (
9         http "net/http"
10         url "net/url"
11         time "time"
12 )
13
14 // Condition uses a Comparison to assert a complex condition.
15 func (a *Assertions) Condition(comp Comparison, msgAndArgs ...interface{}) bool {
16         return Condition(a.t, comp, msgAndArgs...)
17 }
18
19 // Contains asserts that the specified string, list(array, slice...) or map contains the
20 // specified substring or element.
21 //
22 //    a.Contains("Hello World", "World", "But 'Hello World' does contain 'World'")
23 //    a.Contains(["Hello", "World"], "World", "But ["Hello", "World"] does contain 'World'")
24 //    a.Contains({"Hello": "World"}, "Hello", "But {'Hello': 'World'} does contain 'Hello'")
25 //
26 // Returns whether the assertion was successful (true) or not (false).
27 func (a *Assertions) Contains(s interface{}, contains interface{}, msgAndArgs ...interface{}) bool {
28         return Contains(a.t, s, contains, msgAndArgs...)
29 }
30
31 // Empty asserts that the specified object is empty.  I.e. nil, "", false, 0 or either
32 // a slice or a channel with len == 0.
33 //
34 //  a.Empty(obj)
35 //
36 // Returns whether the assertion was successful (true) or not (false).
37 func (a *Assertions) Empty(object interface{}, msgAndArgs ...interface{}) bool {
38         return Empty(a.t, object, msgAndArgs...)
39 }
40
41 // Equal asserts that two objects are equal.
42 //
43 //    a.Equal(123, 123, "123 and 123 should be equal")
44 //
45 // Returns whether the assertion was successful (true) or not (false).
46 //
47 // Pointer variable equality is determined based on the equality of the
48 // referenced values (as opposed to the memory addresses).
49 func (a *Assertions) Equal(expected interface{}, actual interface{}, msgAndArgs ...interface{}) bool {
50         return Equal(a.t, expected, actual, msgAndArgs...)
51 }
52
53 // EqualError asserts that a function returned an error (i.e. not `nil`)
54 // and that it is equal to the provided error.
55 //
56 //   actualObj, err := SomeFunction()
57 //   a.EqualError(err,  expectedErrorString, "An error was expected")
58 //
59 // Returns whether the assertion was successful (true) or not (false).
60 func (a *Assertions) EqualError(theError error, errString string, msgAndArgs ...interface{}) bool {
61         return EqualError(a.t, theError, errString, msgAndArgs...)
62 }
63
64 // EqualValues asserts that two objects are equal or convertable to the same types
65 // and equal.
66 //
67 //    a.EqualValues(uint32(123), int32(123), "123 and 123 should be equal")
68 //
69 // Returns whether the assertion was successful (true) or not (false).
70 func (a *Assertions) EqualValues(expected interface{}, actual interface{}, msgAndArgs ...interface{}) bool {
71         return EqualValues(a.t, expected, actual, msgAndArgs...)
72 }
73
74 // Error asserts that a function returned an error (i.e. not `nil`).
75 //
76 //   actualObj, err := SomeFunction()
77 //   if a.Error(err, "An error was expected") {
78 //         assert.Equal(t, err, expectedError)
79 //   }
80 //
81 // Returns whether the assertion was successful (true) or not (false).
82 func (a *Assertions) Error(err error, msgAndArgs ...interface{}) bool {
83         return Error(a.t, err, msgAndArgs...)
84 }
85
86 // Exactly asserts that two objects are equal is value and type.
87 //
88 //    a.Exactly(int32(123), int64(123), "123 and 123 should NOT be equal")
89 //
90 // Returns whether the assertion was successful (true) or not (false).
91 func (a *Assertions) Exactly(expected interface{}, actual interface{}, msgAndArgs ...interface{}) bool {
92         return Exactly(a.t, expected, actual, msgAndArgs...)
93 }
94
95 // Fail reports a failure through
96 func (a *Assertions) Fail(failureMessage string, msgAndArgs ...interface{}) bool {
97         return Fail(a.t, failureMessage, msgAndArgs...)
98 }
99
100 // FailNow fails test
101 func (a *Assertions) FailNow(failureMessage string, msgAndArgs ...interface{}) bool {
102         return FailNow(a.t, failureMessage, msgAndArgs...)
103 }
104
105 // False asserts that the specified value is false.
106 //
107 //    a.False(myBool, "myBool should be false")
108 //
109 // Returns whether the assertion was successful (true) or not (false).
110 func (a *Assertions) False(value bool, msgAndArgs ...interface{}) bool {
111         return False(a.t, value, msgAndArgs...)
112 }
113
114 // HTTPBodyContains asserts that a specified handler returns a
115 // body that contains a string.
116 //
117 //  a.HTTPBodyContains(myHandler, "www.google.com", nil, "I'm Feeling Lucky")
118 //
119 // Returns whether the assertion was successful (true) or not (false).
120 func (a *Assertions) HTTPBodyContains(handler http.HandlerFunc, method string, url string, values url.Values, str interface{}) bool {
121         return HTTPBodyContains(a.t, handler, method, url, values, str)
122 }
123
124 // HTTPBodyNotContains asserts that a specified handler returns a
125 // body that does not contain a string.
126 //
127 //  a.HTTPBodyNotContains(myHandler, "www.google.com", nil, "I'm Feeling Lucky")
128 //
129 // Returns whether the assertion was successful (true) or not (false).
130 func (a *Assertions) HTTPBodyNotContains(handler http.HandlerFunc, method string, url string, values url.Values, str interface{}) bool {
131         return HTTPBodyNotContains(a.t, handler, method, url, values, str)
132 }
133
134 // HTTPError asserts that a specified handler returns an error status code.
135 //
136 //  a.HTTPError(myHandler, "POST", "/a/b/c", url.Values{"a": []string{"b", "c"}}
137 //
138 // Returns whether the assertion was successful (true) or not (false).
139 func (a *Assertions) HTTPError(handler http.HandlerFunc, method string, url string, values url.Values) bool {
140         return HTTPError(a.t, handler, method, url, values)
141 }
142
143 // HTTPRedirect asserts that a specified handler returns a redirect status code.
144 //
145 //  a.HTTPRedirect(myHandler, "GET", "/a/b/c", url.Values{"a": []string{"b", "c"}}
146 //
147 // Returns whether the assertion was successful (true) or not (false).
148 func (a *Assertions) HTTPRedirect(handler http.HandlerFunc, method string, url string, values url.Values) bool {
149         return HTTPRedirect(a.t, handler, method, url, values)
150 }
151
152 // HTTPSuccess asserts that a specified handler returns a success status code.
153 //
154 //  a.HTTPSuccess(myHandler, "POST", "http://www.google.com", nil)
155 //
156 // Returns whether the assertion was successful (true) or not (false).
157 func (a *Assertions) HTTPSuccess(handler http.HandlerFunc, method string, url string, values url.Values) bool {
158         return HTTPSuccess(a.t, handler, method, url, values)
159 }
160
161 // Implements asserts that an object is implemented by the specified interface.
162 //
163 //    a.Implements((*MyInterface)(nil), new(MyObject), "MyObject")
164 func (a *Assertions) Implements(interfaceObject interface{}, object interface{}, msgAndArgs ...interface{}) bool {
165         return Implements(a.t, interfaceObject, object, msgAndArgs...)
166 }
167
168 // InDelta asserts that the two numerals are within delta of each other.
169 //
170 //       a.InDelta(math.Pi, (22 / 7.0), 0.01)
171 //
172 // Returns whether the assertion was successful (true) or not (false).
173 func (a *Assertions) InDelta(expected interface{}, actual interface{}, delta float64, msgAndArgs ...interface{}) bool {
174         return InDelta(a.t, expected, actual, delta, msgAndArgs...)
175 }
176
177 // InDeltaSlice is the same as InDelta, except it compares two slices.
178 func (a *Assertions) InDeltaSlice(expected interface{}, actual interface{}, delta float64, msgAndArgs ...interface{}) bool {
179         return InDeltaSlice(a.t, expected, actual, delta, msgAndArgs...)
180 }
181
182 // InEpsilon asserts that expected and actual have a relative error less than epsilon
183 //
184 // Returns whether the assertion was successful (true) or not (false).
185 func (a *Assertions) InEpsilon(expected interface{}, actual interface{}, epsilon float64, msgAndArgs ...interface{}) bool {
186         return InEpsilon(a.t, expected, actual, epsilon, msgAndArgs...)
187 }
188
189 // InEpsilonSlice is the same as InEpsilon, except it compares each value from two slices.
190 func (a *Assertions) InEpsilonSlice(expected interface{}, actual interface{}, epsilon float64, msgAndArgs ...interface{}) bool {
191         return InEpsilonSlice(a.t, expected, actual, epsilon, msgAndArgs...)
192 }
193
194 // IsType asserts that the specified objects are of the same type.
195 func (a *Assertions) IsType(expectedType interface{}, object interface{}, msgAndArgs ...interface{}) bool {
196         return IsType(a.t, expectedType, object, msgAndArgs...)
197 }
198
199 // JSONEq asserts that two JSON strings are equivalent.
200 //
201 //  a.JSONEq(`{"hello": "world", "foo": "bar"}`, `{"foo": "bar", "hello": "world"}`)
202 //
203 // Returns whether the assertion was successful (true) or not (false).
204 func (a *Assertions) JSONEq(expected string, actual string, msgAndArgs ...interface{}) bool {
205         return JSONEq(a.t, expected, actual, msgAndArgs...)
206 }
207
208 // Len asserts that the specified object has specific length.
209 // Len also fails if the object has a type that len() not accept.
210 //
211 //    a.Len(mySlice, 3, "The size of slice is not 3")
212 //
213 // Returns whether the assertion was successful (true) or not (false).
214 func (a *Assertions) Len(object interface{}, length int, msgAndArgs ...interface{}) bool {
215         return Len(a.t, object, length, msgAndArgs...)
216 }
217
218 // Nil asserts that the specified object is nil.
219 //
220 //    a.Nil(err, "err should be nothing")
221 //
222 // Returns whether the assertion was successful (true) or not (false).
223 func (a *Assertions) Nil(object interface{}, msgAndArgs ...interface{}) bool {
224         return Nil(a.t, object, msgAndArgs...)
225 }
226
227 // NoError asserts that a function returned no error (i.e. `nil`).
228 //
229 //   actualObj, err := SomeFunction()
230 //   if a.NoError(err) {
231 //         assert.Equal(t, actualObj, expectedObj)
232 //   }
233 //
234 // Returns whether the assertion was successful (true) or not (false).
235 func (a *Assertions) NoError(err error, msgAndArgs ...interface{}) bool {
236         return NoError(a.t, err, msgAndArgs...)
237 }
238
239 // NotContains asserts that the specified string, list(array, slice...) or map does NOT contain the
240 // specified substring or element.
241 //
242 //    a.NotContains("Hello World", "Earth", "But 'Hello World' does NOT contain 'Earth'")
243 //    a.NotContains(["Hello", "World"], "Earth", "But ['Hello', 'World'] does NOT contain 'Earth'")
244 //    a.NotContains({"Hello": "World"}, "Earth", "But {'Hello': 'World'} does NOT contain 'Earth'")
245 //
246 // Returns whether the assertion was successful (true) or not (false).
247 func (a *Assertions) NotContains(s interface{}, contains interface{}, msgAndArgs ...interface{}) bool {
248         return NotContains(a.t, s, contains, msgAndArgs...)
249 }
250
251 // NotEmpty asserts that the specified object is NOT empty.  I.e. not nil, "", false, 0 or either
252 // a slice or a channel with len == 0.
253 //
254 //  if a.NotEmpty(obj) {
255 //    assert.Equal(t, "two", obj[1])
256 //  }
257 //
258 // Returns whether the assertion was successful (true) or not (false).
259 func (a *Assertions) NotEmpty(object interface{}, msgAndArgs ...interface{}) bool {
260         return NotEmpty(a.t, object, msgAndArgs...)
261 }
262
263 // NotEqual asserts that the specified values are NOT equal.
264 //
265 //    a.NotEqual(obj1, obj2, "two objects shouldn't be equal")
266 //
267 // Returns whether the assertion was successful (true) or not (false).
268 //
269 // Pointer variable equality is determined based on the equality of the
270 // referenced values (as opposed to the memory addresses).
271 func (a *Assertions) NotEqual(expected interface{}, actual interface{}, msgAndArgs ...interface{}) bool {
272         return NotEqual(a.t, expected, actual, msgAndArgs...)
273 }
274
275 // NotNil asserts that the specified object is not nil.
276 //
277 //    a.NotNil(err, "err should be something")
278 //
279 // Returns whether the assertion was successful (true) or not (false).
280 func (a *Assertions) NotNil(object interface{}, msgAndArgs ...interface{}) bool {
281         return NotNil(a.t, object, msgAndArgs...)
282 }
283
284 // NotPanics asserts that the code inside the specified PanicTestFunc does NOT panic.
285 //
286 //   a.NotPanics(func(){
287 //     RemainCalm()
288 //   }, "Calling RemainCalm() should NOT panic")
289 //
290 // Returns whether the assertion was successful (true) or not (false).
291 func (a *Assertions) NotPanics(f PanicTestFunc, msgAndArgs ...interface{}) bool {
292         return NotPanics(a.t, f, msgAndArgs...)
293 }
294
295 // NotRegexp asserts that a specified regexp does not match a string.
296 //
297 //  a.NotRegexp(regexp.MustCompile("starts"), "it's starting")
298 //  a.NotRegexp("^start", "it's not starting")
299 //
300 // Returns whether the assertion was successful (true) or not (false).
301 func (a *Assertions) NotRegexp(rx interface{}, str interface{}, msgAndArgs ...interface{}) bool {
302         return NotRegexp(a.t, rx, str, msgAndArgs...)
303 }
304
305 // NotZero asserts that i is not the zero value for its type and returns the truth.
306 func (a *Assertions) NotZero(i interface{}, msgAndArgs ...interface{}) bool {
307         return NotZero(a.t, i, msgAndArgs...)
308 }
309
310 // Panics asserts that the code inside the specified PanicTestFunc panics.
311 //
312 //   a.Panics(func(){
313 //     GoCrazy()
314 //   }, "Calling GoCrazy() should panic")
315 //
316 // Returns whether the assertion was successful (true) or not (false).
317 func (a *Assertions) Panics(f PanicTestFunc, msgAndArgs ...interface{}) bool {
318         return Panics(a.t, f, msgAndArgs...)
319 }
320
321 // Regexp asserts that a specified regexp matches a string.
322 //
323 //  a.Regexp(regexp.MustCompile("start"), "it's starting")
324 //  a.Regexp("start...$", "it's not starting")
325 //
326 // Returns whether the assertion was successful (true) or not (false).
327 func (a *Assertions) Regexp(rx interface{}, str interface{}, msgAndArgs ...interface{}) bool {
328         return Regexp(a.t, rx, str, msgAndArgs...)
329 }
330
331 // True asserts that the specified value is true.
332 //
333 //    a.True(myBool, "myBool should be true")
334 //
335 // Returns whether the assertion was successful (true) or not (false).
336 func (a *Assertions) True(value bool, msgAndArgs ...interface{}) bool {
337         return True(a.t, value, msgAndArgs...)
338 }
339
340 // WithinDuration asserts that the two times are within duration delta of each other.
341 //
342 //   a.WithinDuration(time.Now(), time.Now(), 10*time.Second, "The difference should not be more than 10s")
343 //
344 // Returns whether the assertion was successful (true) or not (false).
345 func (a *Assertions) WithinDuration(expected time.Time, actual time.Time, delta time.Duration, msgAndArgs ...interface{}) bool {
346         return WithinDuration(a.t, expected, actual, delta, msgAndArgs...)
347 }
348
349 // Zero asserts that i is the zero value for its type and returns the truth.
350 func (a *Assertions) Zero(i interface{}, msgAndArgs ...interface{}) bool {
351         return Zero(a.t, i, msgAndArgs...)
352 }