PeanutButter (GitHub, Nuget). I've been slack!Here are the more interesting changes:
PeanutButter.Utilsnow has anetstandard2.0target in the package. So you can use those tasty, tasty utils fromnetcore2.0- This facilitated adding a
netstandard2.0target forPeanutButter.RandomGenerators-- so now you can use theGenericBuilderandRandomValueGen, even on complex types. Yay! Spend more time writing interesting code and less time thinking of a name on yourPersonobject (: - Many fixes to
DeepClone(), the extension method for objects, which gives you back a deep-cloned version of the original, including support for collections and cloning the object's actual type, not the type inferred by the generic usage - so a downcast object is properly cloned now. DeepEqualityTestercan be used to test shapes of objects, without caring about actual values -- simply setOnlyCompareShapeto true. Combined with settingFailOnMissingPropertiesto false, a deep equality test between an instance of your model and an instance of an api model can let you know if your models have at least the required fields to satisfy the target api.- Random object generation always could use
NSubstituteto generate instances of interfaces, but now also supports usingPeanutButter.DuckTyping'sCreate.InstanceOf<T>()to create your random instances. Both strategies are determined at runtime from available assemblies -- there are no hard dependencies onNSubstituteorPeanutButter.DuckTyping. - More async IEnumerable extensions (which allow you to await on a Linq query with async lambdas -- but bear in mind that these won't be translated to, for example, Linq-to-Sql code to run at the server-side):
SelectAsyncToArrayAsyncWhereAsyncAggregateAsync
So, yeah, stuff happened (: