Пример #1
0
        public void InvokeFactoryTest()
        {
            var fact        = new Mock <IFactory>();
            var inputParams = new object[] { new EventArgs() };
            var par         = new FrameworkElement();

            par.DataContext = fact.Object;
            fact.SetupGet(i => i.TargetType).Returns(typeof(string));
            fact.Setup(i => i.Create(It.IsAny <IDIIntegration>(), par, inputParams)).Returns("FooBar");

            Assert.True(ParameterResolver.ResolveParameter(typeof(string), par, inputParams, out var result));
            Assert.Equal("FooBar", result.Create(null, par, inputParams).ToString());
        }