public void GuyWire_Registers_Correct_Components() { var guyWire = new GuyWire(); var count = guyWire.ComponentsInfo.Count(); Assert.Equal(4, count); }
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); }
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))); }
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()); }
public void GuyWire_Has_Default_Container() { var guyWire = new GuyWire(); Assert.NotNull(guyWire.Container); }
protected void CreateGuyWire() { guyWire = new GuyWire(); guyWire.Wire(); }