コード例 #1
0
            public void Should_cache_the_message_convention()
            {
                var timesCalled = 0;
                conventions = new Conventions
                {
                    IsCommandTypeAction = t =>
                    {
                        timesCalled++;
                        return false;
                    }
                };

                conventions.IsCommandType(GetType());
                Assert.AreEqual(1, timesCalled);

                conventions.IsCommandType(GetType());
                Assert.AreEqual(1, timesCalled);
            }
コード例 #2
0
            public void Should_cache_the_message_convention()
            {
                var timesCalled = 0;

                conventions = new Conventions
                {
                    IsCommandTypeAction = t =>
                    {
                        timesCalled++;
                        return(false);
                    }
                };

                conventions.IsCommandType(GetType());
                Assert.AreEqual(1, timesCalled);

                conventions.IsCommandType(GetType());
                Assert.AreEqual(1, timesCalled);
            }