コード例 #1
0
        public void Get_should_produce_correct_message_type()
        {
            var      pool = new MessagePoolMulti();
            IMessage d    = pool.Get(typeof(DummyMessage));

            Assert.AreEqual(typeof(DummyMessage), d.GetType());
        }
コード例 #2
0
        public void Get_should_produce_different_message_types()
        {
            var      pool = new MessagePoolMulti();
            IMessage d    = pool.Get(typeof(DummyMessage));
            IMessage a    = pool.Get(typeof(AltDummyMessage));

            Assert.AreNotEqual(d.GetType(), a.GetType());
        }
コード例 #3
0
        public void Get_mixed_inverse_should_produce_different_messages()
        {
            var      pool = new MessagePoolMulti();
            IMessage d    = pool.Get(typeof(DummyMessage));
            IMessage q    = pool.Get <DummyMessage>();

            Assert.AreNotEqual(d, q);
        }
コード例 #4
0
        public void Get_generic_should_produce_different_messages()
        {
            var      pool = new MessagePoolMulti();
            IMessage d    = pool.Get <DummyMessage>();
            IMessage q    = pool.Get <DummyMessage>();

            Assert.AreNotEqual(d, q);
        }
コード例 #5
0
        public void Get_mixed_inverse_should_produce_same_message()
        {
            var      pool = new MessagePoolMulti();
            IMessage d    = pool.Get(typeof(DummyMessage));

            d.Sent();
            IMessage q = pool.Get <DummyMessage>();

            Assert.AreEqual(d, q);
        }
コード例 #6
0
        public void Get_generic_should_produce_same_message()
        {
            var      pool = new MessagePoolMulti();
            IMessage d    = pool.Get <DummyMessage>();

            d.Sent();
            IMessage q = pool.Get <DummyMessage>();

            Assert.AreEqual(d, q);
        }