Inheritance: IParameterMapper
Esempio n. 1
0
			public void SetUp()
			{
				_container = MockRepository.GenerateMock<IContainer>();
				_container.Stub(arg => arg.GetInstance(typeof(Model))).Return(new Model());
				_context = MockRepository.GenerateMock<HttpContextBase>();
				_mapper = new ModelMapper(_container);
			}
Esempio n. 2
0
			public void SetUp()
			{
				_context = MockRepository.GenerateMock<HttpContextBase>();
				_modelPropertyMapper1 = MockRepository.GenerateMock<IModelPropertyMapper>();
				_modelPropertyMapper1
					.Stub(arg => arg.CanMapTypeAsync(Arg<Type>.Is.Anything))
					.WhenCalled(arg => arg.ReturnValue = (((Type)arg.Arguments.First()) == typeof(string)).AsCompletedTask())
					.Return(false.AsCompletedTask());
				_modelPropertyMapper1.Stub(arg => arg.MapAsync(Arg<HttpRequestBase>.Is.Anything, Arg<Type>.Is.Anything, Arg<PropertyInfo>.Is.Anything)).Return(MapResult.ValueMapped("value").AsCompletedTask());
				_modelPropertyMapper2 = MockRepository.GenerateMock<IModelPropertyMapper>();
				_modelPropertyMapper2
					.Stub(arg => arg.CanMapTypeAsync(Arg<Type>.Is.Anything))
					.WhenCalled(arg => arg.ReturnValue = (((Type)arg.Arguments.First()) == typeof(string)).AsCompletedTask())
					.Return(false.AsCompletedTask());
				_modelPropertyMapper2.Stub(arg => arg.MapAsync(Arg<HttpRequestBase>.Is.Anything, Arg<Type>.Is.Anything, Arg<PropertyInfo>.Is.Anything)).Return(MapResult.ValueMapped("value").AsCompletedTask());
				_modelMapper = new ModelMapper(_modelPropertyMapper1, _modelPropertyMapper2);
			}
Esempio n. 3
0
			public void SetUp()
			{
				_context = MockRepository.GenerateMock<HttpContextBase>();
				_mapper = new ModelMapper(
					type =>
						{
							_executed = true;
							return true;
						});
			}
Esempio n. 4
0
			public void SetUp()
			{
				_context = MockRepository.GenerateMock<HttpContextBase>();
				_mapper = new ModelMapper();
			}
Esempio n. 5
0
 public void SetUp()
 {
     _request = MockRepository.GenerateMock<HttpRequestBase>();
     _mapper = new ModelMapper();
 }