protected override void beforeEach() { output = new JsonOutput { Name = "Max", Age = 6 }; requestData = new InMemoryRequestData(); Services.Inject <IRequestData>(requestData); mimeType = null; rawOutput = null; MockFor <IOutputWriter>().Stub(x => x.Write(null, null)).IgnoreArguments().Do( new Action <string, string>((t, o) => { mimeType = t; rawOutput = o; })); requestData["X-Requested-With"] = "XMLHttpRequest"; ClassUnderTest.Write(output); }
protected override void beforeEach() { output = new JsonOutput { Name = "Max", Age = 6 }; requestData = new InMemoryRequestData(); Services.Inject <IRequestData>(requestData); theOutputWriter = new InMemoryOutputWriter(); Services.Inject <IOutputWriter>(theOutputWriter); requestData["X-Requested-With"] = "XMLHttpRequest"; ClassUnderTest.Write(output); }
public void SetUp() { data = new InMemoryRequestData(); detector = new DebugDetector(data); }
public void SetUp() { registry = new ValueConverterRegistry(new IConverterFamily[0]); data = new InMemoryRequestData(); binder = new StandardModelBinder(registry, new TypeDescriptorRegistry()); locator = MockRepository.GenerateMock<IServiceLocator>(); result = null; }
public void SetUp() { request = new InMemoryRequestData(); locator = MockRepository.GenerateMock<IServiceLocator>(); context = new BindingContext(request, locator); }
public void SetUp() { var container = StructureMapContainerFacility.GetBasicFubuContainer(); data = new InMemoryRequestData(); container.Inject<IRequestData>(data); context = container.GetInstance<BindingContext>(); holder = new HolderClass(); data["SpecialName"] = "Jeremy"; data["SpecialAge"] = "36"; data["SpecialColor"] = "red"; context.StartObject(holder); var property = ReflectionHelper.GetProperty<HolderClass>(x => x.HeldClass); context.BindChild(property, typeof(SpecialClassThatIsHeld), "Special"); }
public void SetUp() { var container = StructureMapContainerFacility.GetBasicFubuContainer(); data = new InMemoryRequestData(); container.Inject<IRequestData>(data); context = container.GetInstance<BindingContext>(); holder = new HolderClass(); data["HeldClassName"] = "Jeremy"; data["HeldClassAge"] = "NOT A NUMBER"; context.StartObject(holder); var property = ReflectionHelper.GetProperty<HolderClass>(x => x.HeldClass); context.BindChild(property); }
private InMemoryBindingContext(InMemoryRequestData data, IContainer container) : base(data, new StructureMapServiceLocator(container)) { _data = data; _container = container; }