Exemplo n.º 1
0
        public void CreateNewRefernce()
        {
            Mock <IObjectCreator> creatorMock = new Mock <IObjectCreator>();
            var         target       = new ReferenceInfo(5);
            SampleClass sampleObject = new SampleClass();

            creatorMock.Setup(o => o.GetObjectReference(target)).Returns(sampleObject);
            var result = target.GetInstance(creatorMock.Object);

            Assert.IsInstanceOfType(result, typeof(SampleClass));
        }