Contributor description:
Fixing expectation message whereby the wrong type is contained within the exception making it confusing to the end-user.
Take for example the following test:
Unable to find source-code formatter for language: csharp. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
[Fact] public void Test1() { PipelineDefinition<BsonDocument, MyType>.Create(new IPipelineStageDefinition[] { new JsonPipelineStageDefinition<BsonDocument, BsonDocument>( @"{ project: { } } "), }); } public class MyType { }
This throws the following exception
Unable to find source-code formatter for language: csharp. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
System.ArgumentException : The output type to the last stage was expected to be MongoDB.Bson.BsonDocument, but was MongoDB.Bson.BsonDocument. (Parameter 'stages')
instead of
Unable to find source-code formatter for language: csharp. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
System.ArgumentException : The output type to the last stage was expected to be SomeExample.MyType, but was MongoDB.Bson.BsonDocument. (Parameter 'stages')
Contributor PR:
https://github.com/mongodb/mongo-csharp-driver/pull/392