예제 #1
0
            public void WhenAdaptManyDoesNotReturnNull_ReturnsEmptyEnumerable()
            {
                A.CallTo(() => _testAdapter.Adapt(A <DateTime> ._)).Returns(true);
                var expected = _sampleInput.Select(str => true);

                _testAdapter.AdaptManyOrEmpty(_sampleInput).Should().BeEquivalentTo(expected);
            }
예제 #2
0
            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);
            }
예제 #3
0
            public void GivenNullAdapter_Throws()
            {
                _testAdapter = null;
                Action act = () => _testAdapter.AdaptManyOrEmpty(_sampleInput);

                act.Should().Throw <ArgumentNullException>();
            }