Exemplo n.º 1
0
        public void GuyWire_Registers_Correct_Components()
        {
            var guyWire = new GuyWire();
            var count   = guyWire.ComponentsInfo.Count();

            Assert.Equal(4, count);
        }
Exemplo n.º 2
0
        public InstallersTests()
        {
            _container = new WindsorContainer();

            _guyWire = MockRepository.GenerateMock <GuyWire>(_container);
            _guyWire.Expect(g => g.Container).Return(_container);
            _guyWire.Expect(g => g.Wire()).CallOriginalMethod(OriginalCallOptions.CreateExpectation);
        }
Exemplo n.º 3
0
        public void Can_Show_Root_ViewModel()
        {
            var winManager = MockRepository.GenerateMock <IWindowManager>();
            var shell      = MockRepository.GenerateMock <IShellViewModel>();
            var container  = new WindsorContainer();
            var guyWire    = new GuyWire(container);

            container.Kernel.AddComponentInstance <IWindowManager>(winManager);
            container.Kernel.AddComponentInstance <IShellViewModel>(shell);

            guyWire.ShowRootModel();

            winManager.AssertWasCalled(x => x.Show(Arg.Is(shell), Arg.Is <object>(null)));
        }
Exemplo n.º 4
0
        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();

            RegisterRoutes(RouteTable.Routes);

            // Service Locator
            GuyWire guyWire = new GuyWire();

            guyWire.Wire();

            // Model Binders
            System.Web.Mvc.ModelBinders.Binders.Add(typeof(DateTime?), new LocalizedBinder());
            System.Web.Mvc.ModelBinders.Binders.Add(typeof(decimal?), new LocalizedBinder());
            System.Web.Mvc.ModelBinders.Binders.Add(typeof(float?), new LocalizedBinder());
            System.Web.Mvc.ModelBinders.Binders.Add(typeof(double?), new LocalizedBinder());
            System.Web.Mvc.ModelBinders.Binders.Add(typeof(DateTime), new LocalizedBinder());
            System.Web.Mvc.ModelBinders.Binders.Add(typeof(decimal), new LocalizedBinder());
            System.Web.Mvc.ModelBinders.Binders.Add(typeof(float), new LocalizedBinder());
            System.Web.Mvc.ModelBinders.Binders.Add(typeof(double), new LocalizedBinder());
            System.Web.Mvc.ModelBinders.Binders.Add(typeof(string), new StringBinder());
        }
Exemplo n.º 5
0
        public void GuyWire_Has_Default_Container()
        {
            var guyWire = new GuyWire();

            Assert.NotNull(guyWire.Container);
        }
Exemplo n.º 6
0
 protected void CreateGuyWire()
 {
     guyWire = new GuyWire();
     guyWire.Wire();
 }