exactly

The phrase .contain.exactly indicates that two ranges are expected to contain exactly the same elements, but possibly in a different order.

void
exactly
(
Should
T
)
(
Should should
,,
Fence _ = Fence()
,
string file = __FILE__
,
size_t line = __LINE__
)
if (
isInstanceOf!(ShouldType, Should)
)

Examples

import dshould : equal;
import dshould.stringcmp : green, red;
import dshould.thrown : throwA;

[3, 4].should.contain.exactly([3, 4]);
[3, 4].should.contain.exactly([4, 3]);
[3, 4].should.contain.exactly([3]).should.throwA!FluentException.where.msg.should.equal(
    "Test failed: expected exact set of values, but got \n"
    ~ "[\n"
    ~ "   3,\n"
    ~ green("+  4") ~ "\n"
    ~ "]");
[3, 4].should.contain.exactly([3, 4, 5]).should.throwA!FluentException.where.msg.should.equal(
    "Test failed: expected exact set of values, but got \n"
    ~ "[\n"
    ~ "   3,\n"
    ~ "   4,\n"
    ~ red("-  5") ~ "\n"
    ~ "]");
[3, 4].should.contain.exactly([3, 5]).should.throwA!FluentException.where.msg.should.equal(
    "Test failed: expected exact set of values, but got \n"
    ~ "[\n"
    ~ "   3,\n"
    ~ green("+  4") ~ ",\n"
    ~ red("-  5") ~ "\n"
    ~ "]");

Meta