Пример #1
0
        public void IConsumer_()
        {
            var mockPublisher = new Mock <IConsumer <SBase> >();
            var publisher     = mockPublisher.Object;
            var myS           = new S("s");

            publisher.Consume(myS, null);
            var myS1 = new SBase("s1");

            publisher.Consume(myS1, null);

            mockPublisher.Verify(o => o.Consume(myS, null), Times.Once);
            mockPublisher.Verify(o => o.Consume(myS1, null), Times.Once);
        }
Пример #2
0
        public void IPublisher_()
        {
            var mockPublisher = new Mock <IPublisher <SBase> >();
            var publisher     = mockPublisher.Object;
            var myS           = new S("s");

            publisher.Publish(myS);
            var myS1 = new SBase("s1");

            publisher.Publish(myS1);

            mockPublisher.Verify(o => o.Publish(myS), Times.Once);
            mockPublisher.Verify(o => o.Publish(myS1), Times.Once);
        }