public void WhenAdaptManyDoesNotReturnNull_ReturnsEmptyEnumerable() { A.CallTo(() => _testAdapter.Adapt(A <DateTime> ._)).Returns(true); var expected = _sampleInput.Select(str => true); _testAdapter.AdaptManyOrEmpty(_sampleInput).Should().BeEquivalentTo(expected); }
public void WhenAdaptManyDoesNotReturnNull_ReturnsResultFromAdaptMany() { A.CallTo(() => _testAdapter.Adapt(A <string> ._)) .ReturnsLazily(fakeCall => new Foo { Value = fakeCall.Arguments.Get <string>(0) }); var expected = _sampleInput.Select(str => new Foo { Value = str }); _testAdapter.AdaptManyOrEmpty(_sampleInput).Should().BeEquivalentTo(expected); }
public void GivenNullAdapter_Throws() { _testAdapter = null; Action act = () => _testAdapter.AdaptManyOrEmpty(_sampleInput); act.Should().Throw <ArgumentNullException>(); }