Ejemplo n.º 1
0
        public void CreateBatch()
        {
            object asyncState = new object();
            IBatch innerBatch = new Mock <IBatch>().Object;

            mock.Setup(_ => _.CreateBatch(asyncState)).Returns(innerBatch);
            IBatch wrappedBatch = wrapper.CreateBatch(asyncState);

            mock.Verify(_ => _.CreateBatch(asyncState));
            Assert.IsInstanceOf <BatchWrapper>(wrappedBatch);
            Assert.AreSame(innerBatch, ((BatchWrapper)wrappedBatch).Inner);
        }