Esempio n. 1
0
        public void Initialize()
        {
            var context = new Mock <IContextAware>();

            var view = new Mock <ISelectScriptLanguageView>();
            {
                view.SetupSet(v => v.Model = It.IsAny <SelectScriptLanguageModel>())
                .Verifiable();
            }

            var parameter = new SelectScriptLanguageParameter(context.Object);
            var container = new Mock <IDependencyInjectionProxy>();
            {
                container.Setup(c => c.Resolve <IContextAware>())
                .Returns(context.Object);
            }

            var presenter = new SelectScriptLanguagePresenter(container.Object);

            ((IPresenter)presenter).Initialize(view.Object, parameter);

            Assert.AreSame(view.Object, presenter.View);
            Assert.AreSame(parameter, presenter.Parameter);
            view.VerifySet(v => v.Model = It.IsAny <SelectScriptLanguageModel>(), Times.Once());
        }
        public void Initialize()
        {
            var context = new Mock<IContextAware>();

            var view = new Mock<ISelectScriptLanguageView>();
            {
                view.SetupSet(v => v.Model = It.IsAny<SelectScriptLanguageModel>())
                    .Verifiable();
            }

            var parameter = new SelectScriptLanguageParameter(context.Object);
            var container = new Mock<IDependencyInjectionProxy>();
            {
                container.Setup(c => c.Resolve<IContextAware>())
                    .Returns(context.Object);
            }

            var presenter = new SelectScriptLanguagePresenter(container.Object);
            ((IPresenter)presenter).Initialize(view.Object, parameter);

            Assert.AreSame(view.Object, presenter.View);
            Assert.AreSame(parameter, presenter.Parameter);
            view.VerifySet(v => v.Model = It.IsAny<SelectScriptLanguageModel>(), Times.Once());
        }