Пример #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>();
            }