[Test]
public void SimpleFlatten()
{
var sentences = new List<string> { "Hello World", "Goodbye World" };
var result = sentences.SelectMany(n => n.Split(' '));
Assert.That(result.Count(), Is.EqualTo(4));
}
Will the number of results be checked here?
Thinking logically about this, I feel that checking the account should be sufficient, because I have no reasonable suspicion that the method SelectManywill ever return the correct number if the method works correctly.
I am new to TDD and wondering if it will be more explicit, like this, better?
CollectionAssert.AreEquivalent(
new[] { "Hello", "World", "Goodbye", "World" }, result);
source
share