Description
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:
[Fact]
|
public void Test1() |
{
|
PipelineDefinition<BsonDocument, MyType>.Create(new IPipelineStageDefinition[] |
{
|
new JsonPipelineStageDefinition<BsonDocument, BsonDocument>( |
@"{ project: { } } "), |
});
|
}
|
|
|
public class MyType { } |
This throws the following exception
|
|
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
|
|
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