public void Adds_Value() { // Arrange var value = Rnd.Str; var name = Rnd.Str; var param = new Jsonb(value); var collection = Substitute.For <IDataParameterCollection>(); var command = Substitute.For <IDbCommand>(); command.Parameters.Returns(collection); // Act param.AddParameter(command, name); // Assert collection.Received().Add(Arg.Is <NpgsqlParameter>(p => p.Value == (object)value)); }