forked from shouldly/shouldly
-
Notifications
You must be signed in to change notification settings - Fork 0
/
BREAKING CHANGES.txt
39 lines (34 loc) · 2.29 KB
/
BREAKING CHANGES.txt
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
v1.1 -> v2.0 Breaking Changes
# ShouldBeGreaterThan and ShouldBeLessThan are now constrained to IComparable<T>
If you are doing something like this `1.ShouldBeLessThan(3f)` then cast one of the types so they are the same type
i.e `((float)1).ShouldBeLessThan(3f)`
# Method Grouping on Should.Throw no longer works due to async overloads.
Change `Should.Throw(service.DoSomething)` to `Should.Throw(() => service.DoSomething)`
# IEnumerable.ShouldBe(IEnumerable) now uses .Equals to compare
- This is because of c#'s overload selection, it will always pick the ShouldBe<T>(T, T) overload rather than ShouldBe<T>(IEnumerable<T>, IEnumerable<T>)
- There are two ways to select the IEnumerable overload:
- Specify T. i.e new[]{"foo"}.ShouldBe<string>(new[]{"foo"});
- Specify the `ignoreOrder` parameter. i.e new[]{"foo"}.ShouldBe(new[]{"foo"}, ignoreOrder: false)
- Make expected value less specific than actual, for instance: `new[]{"foo"}.ShouldBe(new[]{"foo"}.AsEnumerable())`
# ShouldBeTypeOf<T> renamed to ShouldBeAssignableTo<T>
v1.0 -> v1.1 Breaking Changes
# Shouldly.Should.Throw<TException> changed to return thrown exception when failed, rather than exception message
FIX: Any code relying on Throw<T>() to return a string should update to call Message. Eg:
Should.Throw<SomeException>(() => throw new OtherException()).Message.ShouldBe("Threw other exception");
# Rhino Mocks has been deprecated from Shouldly.
Won't break build as such, but please bear in mind that plans are to remove this functionality from Shouldly
This also means the NuGet package has been updated to remove the explicit dependency on Rhino.Mocks.
# The following classes have been marked internal. They shouldn't have been marked public:
Shouldly.ObjectHelpers
T As<T>()
Shouldly.ShouldlyCoreExtentions
void AssertAwesomely<T>()
Shouldly.TestEnvironment
Shouldly.ShouldlyMessage
Shouldly.ShouldlyMethodsAttribute
Shouldly.StringHelpers
string CommaDelimited<T>()
string DelimitWith<T>()
string Inspect()
If you're using these methods, please implement locally before updating to v1.1
====EOF====