Beispiel #1
0
        public void Test_SingleConstructor_Called( )
        {
            IImportReporter reporter = new Mock <IImportReporter>( ).Object;
            int             called   = 0;
            Action <IObjectReader, IEntity, IImportReporter> singleAction = (x, y, reporter1) => { called++; };
            var processor = new MemberProcessor(singleAction);

            var pairs = new ReaderEntityPair []
            {
                new ReaderEntityPair(null, null),
                new ReaderEntityPair(null, null)
            };

            processor.Action(pairs, reporter);
            Assert.That(called, Is.EqualTo(2));
        }
Beispiel #2
0
        public void Test_BulkConstructor_Called( )
        {
            IImportReporter reporter = new Mock <IImportReporter>( ).Object;
            int             called   = 0;
            Action <IEnumerable <ReaderEntityPair>, IImportReporter> bulkAction = (pairs1, reporter1) => { called++; };
            var processor = new MemberProcessor(bulkAction);

            var pairs = new ReaderEntityPair []
            {
                new ReaderEntityPair(null, null),
                new ReaderEntityPair(null, null)
            };

            processor.Action(pairs, reporter);
            Assert.That(called, Is.EqualTo(1));
        }