var expected = new object[] { viewModel }.Concat(viewModel.Items);
This triggers WTG3014: Don't use Concat when prepending a single element to an enumerable.
The code-fix changes it to:
var expected = viewModel.Items.Prepend(viewModel);
However, viewModel and viewModel.Items do not share a common type, so this then causes CS0411: The type arguments for method 'Enumerable.Prepend(IEnumerable, TSource)' cannot be inferred from the usage. Try specifying the type arguments explicitly.
We should probably change this to .Prepend<object> to preserve the explicit typing.
This triggers WTG3014: Don't use Concat when prepending a single element to an enumerable.
The code-fix changes it to:
However,(IEnumerable, TSource)' cannot be inferred from the usage. Try specifying the type arguments explicitly.
viewModel
andviewModel.Items
do not share a common type, so this then causes CS0411: The type arguments for method 'Enumerable.PrependWe should probably change this to
.Prepend<object>
to preserve the explicit typing.