예제 #1
0
        public void IsRegistered_SecondReturnsTrue()
        {
            _nodeTypeProviderMock1
            .Expect(mock => mock.IsRegistered(_methodInfo))
            .Return(false);
            _nodeTypeProviderMock2
            .Expect(mock => mock.IsRegistered(_methodInfo))
            .Return(true);
            _nodeTypeProviderMock1.Replay();
            _nodeTypeProviderMock2.Replay();

            var result = _compoundProvider.IsRegistered(_methodInfo);

            _nodeTypeProviderMock1.VerifyAllExpectations();
            _nodeTypeProviderMock2.VerifyAllExpectations();
            Assert.That(result, Is.True);
        }
예제 #2
0
        public void IsRegistered_FirstReturnsTrue()
        {
            _nodeTypeProviderMock1
            .Expect(mock => mock.IsRegistered(_methodInfo))
            .Return(true);
            _nodeTypeProviderMock1.Replay();
            _nodeTypeProviderMock2.Replay();

            var result = _compoundProvider.IsRegistered(_methodInfo);

            _nodeTypeProviderMock1.VerifyAllExpectations();
            _nodeTypeProviderMock2.AssertWasNotCalled(mock => mock.IsRegistered(Arg <MethodInfo> .Is.Anything));
            Assert.That(result, Is.True);
        }