asList
Turns Expect<Array<E>>
into Expect<List<E>>
.
The transformation as such is not reflected in reporting. Use feature { f(it::asList) }
if you want to show the transformation in reporting.
Return
The newly created Expect for the transformed subject.
Since
0.12.0
Samples
expect(arrayOf("A", "B")) asList o toEqual listOf("A", "B")
// | subject is now of type List<String>
Turns Expect<CharArray>
into Expect<List<Byte>>
.
The transformation as such is not reflected in reporting. Use feature { f(it::asList) }
if you want to show the transformation in reporting.
Return
The newly created Expect for the transformed subject.
Since
0.12.0
Samples
expect(byteArrayOf(1, 2, 3)) asList o toEqual listOf<Byte>(1, 2, 3)
// | subject is now of type List<Byte>
Expects that the subject of this
expectation holds all assertions the given assertionCreator creates for the subject as List.
The transformation as such is not reflected in reporting. Use feature of({ f(it::asList) }, assertionCreator)
if you want to show the transformation in reporting.
Return
The newly created Expect for the transformed subject.
Since
0.12.0
Samples
expect(byteArrayOf(1, 2, 3))
.asList { // subject within this expectation-group is of type List<Byte>
it toEqual listOf<Byte>(1, 2, 3)
} // subject here is back to type Array<Byte>
fails {
// all expectations inside an expectation-group are evaluated together; for more details see:
// https://github.com/robstoll/atrium#define-single-expectations-or-an-expectation-group
expect(byteArrayOf(1, 2, 3))
.asList {
it toContain 98 // fails
it toContain 99 // still evaluated even though above `toContain` already fails
// use `asList o` if you want a fail fast behaviour
}
}
Turns Expect<CharArray>
into Expect<List<Char>>
.
The transformation as such is not reflected in reporting. Use feature { f(it::asList) }
if you want to show the transformation in reporting.
Return
The newly created Expect for the transformed subject.
Since
0.12.0
Samples
expect(charArrayOf('A', 'B', 'C')) asList o toEqual listOf('A', 'B', 'C')
// | subject is now of type List<Char>
Expects that the subject of this
expectation holds all assertions the given assertionCreator creates for the subject as List.
The transformation as such is not reflected in reporting. Use feature of({ f(it::asList) }, assertionCreator)
if you want to show the transformation in reporting.
Return
The newly created Expect for the transformed subject.
Since
0.12.0
Samples
expect(charArrayOf('A', 'B', 'C'))
.asList { // subject within this expectation-group is of type List<Char>
it toEqual listOf('A', 'B', 'C')
} // subject here is back to type Array<Char>
fails {
// all expectations inside an expectation-group are evaluated together; for more details see:
// https://github.com/robstoll/atrium#define-single-expectations-or-an-expectation-group
expect(charArrayOf('A', 'B', 'C'))
.asList {
it toContain 'X' // fails
it toContain 'Y' // still evaluated even though above `toContain` already fails
// use `asList o` if you want a fail fast behaviour
}
}
Turns Expect<ShortArray>
into Expect<List<Short>>
.
The transformation as such is not reflected in reporting. Use feature { f(it::asList) }
if you want to show the transformation in reporting.
Return
The newly created Expect for the transformed subject.
Since
0.12.0
Samples
expect(shortArrayOf(1, 2, 3)) asList o toEqual listOf<Short>(1, 2, 3)
// | subject is now of type List<Short>
Expects that the subject of this
expectation holds all assertions the given assertionCreator creates for the subject as List.
The transformation as such is not reflected in reporting. Use feature of({ f(it::asList) }, assertionCreator)
if you want to show the transformation in reporting.
Return
The newly created Expect for the transformed subject.
Since
0.12.0
Samples
expect(shortArrayOf(1, 2, 3))
.asList { // subject within this expectation-group is of type List<Short>
it toEqual listOf<Short>(1, 2, 3)
} // subject here is back to type Array<Short>
fails {
// all expectations inside an expectation-group are evaluated together; for more details see:
// https://github.com/robstoll/atrium#define-single-expectations-or-an-expectation-group
expect(shortArrayOf(1, 2, 3))
.asList {
it toContain 98 // fails
it toContain 99 // still evaluated even though above `toContain` already fails
// use `asList o` if you want a fail fast behaviour
}
}
Turns Expect<IntArray>
into Expect<List<Int>>
.
The transformation as such is not reflected in reporting. Use feature { f(it::asList) }
if you want to show the transformation in reporting.
Return
The newly created Expect for the transformed subject.
Since
0.12.0
Samples
expect(intArrayOf(1, 2, 3)) asList o toEqual listOf(1, 2, 3)
// | subject is now of type List<Int>
Expects that the subject of this
expectation holds all assertions the given assertionCreator creates for the subject as List.
The transformation as such is not reflected in reporting. Use feature of({ f(it::asList) }, assertionCreator)
if you want to show the transformation in reporting.
Return
The newly created Expect for the transformed subject.
Since
0.12.0
Samples
expect(intArrayOf(1, 2, 3))
.asList { // subject within this expectation-group is of type List<Int>
it toEqual listOf(1, 2, 3)
} // subject here is back to type Array<Int>
fails {
// all expectations inside an expectation-group are evaluated together; for more details see:
// https://github.com/robstoll/atrium#define-single-expectations-or-an-expectation-group
expect(intArrayOf(1, 2, 3))
.asList {
it toContain 98 // fails
it toContain 99 // still evaluated even though above `toContain` already fails
// use `asList o` if you want a fail fast behaviour
}
}
Turns Expect<LongArray>
into Expect<List<Double>>
.
The transformation as such is not reflected in reporting. Use feature { f(it::asList) }
if you want to show the transformation in reporting.
Return
The newly created Expect for the transformed subject.
Since
0.12.0
Samples
expect(longArrayOf(1L, 2L, 3L)) asList o toEqual listOf(1L, 2L, 3L)
// | subject is now of type List<Long>
Expects that the subject of this
expectation holds all assertions the given assertionCreator creates for the subject as List.
The transformation as such is not reflected in reporting. Use feature of({ f(it::asList) }, assertionCreator)
if you want to show the transformation in reporting.
Return
The newly created Expect for the transformed subject.
Since
0.12.0
Samples
expect(longArrayOf(1L, 2L, 3L))
.asList { // subject within this expectation-group is of type List<Long>
it toEqual listOf(1L, 2L, 3L)
} // subject here is back to type Array<Long>
fails {
// all expectations inside an expectation-group are evaluated together; for more details see:
// https://github.com/robstoll/atrium#define-single-expectations-or-an-expectation-group
expect(longArrayOf(1L, 2L, 3L))
.asList {
it toContain 98L // fails
it toContain 99L // still evaluated even though above `toContain` already fails
// use `asList o` if you want a fail fast behaviour
}
}
Turns Expect<FloatArray>
into Expect<List<Float>>
.
The transformation as such is not reflected in reporting. Use feature { f(it::asList) }
if you want to show the transformation in reporting.
Return
The newly created Expect for the transformed subject.
Since
0.12.0
Samples
expect(floatArrayOf(1f, 2f, 3f)) asList o toEqual listOf(1f, 2f, 3f)
// | subject is now of type List<Float>
Expects that the subject of this
expectation holds all assertions the given assertionCreator creates for the subject as List.
The transformation as such is not reflected in reporting. Use feature of({ f(it::asList) }, assertionCreator)
if you want to show the transformation in reporting.
Return
The newly created Expect for the transformed subject.
Since
0.12.0
Samples
expect(floatArrayOf(1f, 2f, 3f))
.asList { // subject within this expectation-group is of type List<Float>
it toEqual listOf(1f, 2f, 3f)
} // subject here is back to type Array<Float>
fails {
// all expectations inside an expectation-group are evaluated together; for more details see:
// https://github.com/robstoll/atrium#define-single-expectations-or-an-expectation-group
expect(floatArrayOf(1f, 2f, 3f))
.asList {
it toContain 98f // fails
it toContain 99f // still evaluated even though above `toContain` already fails
// use `asList o` if you want a fail fast behaviour
}
}
Turns Expect<DoubleArray>
into Expect<List<Double>>
.
The transformation as such is not reflected in reporting. Use feature { f(it::asList) }
if you want to show the transformation in reporting.
Return
The newly created Expect for the transformed subject.
Since
0.12.0
Samples
expect(doubleArrayOf(1.1, 2.2, 3.3)) asList o toEqual listOf(1.1, 2.2, 3.3)
// | subject is now of type List<Double>
Expects that the subject of this
expectation holds all assertions the given assertionCreator creates for the subject as List.
The transformation as such is not reflected in reporting. Use feature of({ f(it::asList) }, assertionCreator)
if you want to show the transformation in reporting.
Return
The newly created Expect for the transformed subject.
Since
0.12.0
Samples
expect(doubleArrayOf(1.1, 2.2, 3.3))
.asList { // subject within this expectation-group is of type List<Double>
it toEqual listOf(1.1, 2.2, 3.3)
} // subject here is back to type Array<Double>
fails {
// all expectations inside an expectation-group are evaluated together; for more details see:
// https://github.com/robstoll/atrium#define-single-expectations-or-an-expectation-group
expect(doubleArrayOf(1.1, 2.2, 3.3))
.asList {
it toContain 98.1 // fails
it toContain 99.2 // still evaluated even though above `toContain` already fails
// use `asList o` if you want a fail fast behaviour
}
}
Turns Expect<BooleanArray>
into Expect<List<Boolean>>
.
The transformation as such is not reflected in reporting. Use feature { f(it::asList) }
if you want to show the transformation in reporting.
Return
The newly created Expect for the transformed subject.
Since
0.12.0
Samples
expect(booleanArrayOf(true, false)) asList o toEqual listOf(true, false)
// | subject is now of type List<Boolean>
Expects that the subject of this
expectation holds all assertions the given assertionCreator creates for the subject as List.
The transformation as such is not reflected in reporting. Use feature of({ f(it::asList) }, assertionCreator)
if you want to show the transformation in reporting.
Return
The newly created Expect for the transformed subject.
Since
0.12.0
Samples
expect(booleanArrayOf(true, false))
.asList { // subject within this expectation-group is of type List<Boolean>
it toEqual listOf(true, false)
} // subject here is back to type Array<Boolean>
fails {
// all expectations inside an expectation-group are evaluated together; for more details see:
// https://github.com/robstoll/atrium#define-single-expectations-or-an-expectation-group
expect(booleanArrayOf(true, true))
.asList {
it toContain false // fails
it toContain o inAny order atLeast 3 value true // still evaluated even though above `toContain` already fails
// use `asList o` if you want a fail fast behaviour
}
}
Turns Expect<E, T : Iterable<E>>
into Expect<List<E>
.
The transformation as such is not reflected in reporting. Use feature { f(it::asList) }
if you want to show the transformation in reporting.
Return
The newly created Expect for the transformed subject.
Since
0.14.0
Samples
expect(0..2) asList o toEqual listOf(0, 1, 2)
// | subject is now of type List<Int>
fails {
expect(0..2) asList o toContain 3 toContain 4
}
Expects that the subject of this
expectation holds all assertions the given assertionCreator creates for the subject as List.
The transformation as such is not reflected in reporting. Use feature of({ f(it::asList) }, assertionCreator)
if you want to show the transformation in reporting.
Return
an Expect for the subject of this
expectation.
Since
0.14.0
Samples
expect(0..2)
.asList { // subject within this expectation-group is of type List<Int>
it toEqual listOf(0, 1, 2)
} // subject here is back to type IntRange
fails {
// all expectations inside an expectation-group are evaluated together; for more details see:
// https://github.com/robstoll/atrium#define-single-expectations-or-an-expectation-group
expect(0..2)
.asList {
it toContain 3 // fails
it toContain 4 // still evaluated even though above `toContain` already fails
// use `asList o` if you want a fail fast behaviour
}
}
Turns Expect<E, T : Sequence<E>>
into Expect<List<E>
.
The transformation as such is not reflected in reporting. Use feature { f(it::toList) }
if you want to show the transformation in reporting.
Return
The newly created Expect for the transformed subject.
Since
0.14.0
Expects that the subject of this
expectation holds all assertions the given assertionCreator creates for the subject as List.
The transformation as such is not reflected in reporting. Use feature of({ f(it::toList) }, assertionCreator)
if you want to show the transformation in reporting.
Return
an Expect for the subject of this
expectation.
Since
0.14.0