protected override void Establish_context()
		{
			_sut = new EventPlugin(MockRepository.GenerateMock<IPostRepository>(),
								   MockRepository.GenerateMock<IMapper<NameValueCollection, Settings>>(),
								   MockRepository.GenerateMock<IValidator<Settings>>());

			_post = MockRepository.GenerateStub<DataBuddyBase>();
		}
예제 #2
0
		protected override void Establish_context()
		{
			base.Establish_context();

			_sut = Container.Create<EventPlugin>();

			_post = MockRepository.GenerateStub<DataBuddyBase>();

			Mocks.ReplayAll();
		}
		protected override void Establish_context()
		{
			var postRepository = MockRepository.GenerateMock<IPostRepository>();
			_sut = new EventPlugin(postRepository,
								   MockRepository.GenerateMock<IMapper<NameValueCollection, Settings>>(),
								   MockRepository.GenerateMock<IValidator<Settings>>()) { CategoryName = "Event category" };

			_post = new Post();

			postRepository.Stub(x => x.GetCategoryNameOf(_post)).Return("Some other category");
		}
예제 #4
0
		protected override void Establish_context()
		{
			base.Establish_context();

			_sut = Container.Create<EventPlugin>();
			_sut.CategoryName = "Event category";

			_post = new Post();

			IoC.Resolve<IPostRepository>().Stub(x => x.GetCategoryNameOf(_post)).Return("Some other category");
			IoC.Resolve<IEventValidator>()
				.Expect(x => x.Validate(_post))
				.Return(null)
				.Repeat.Never();

			Mocks.ReplayAll();
		}
		protected override void Establish_context()
		{
			var postRepository = MockRepository.GenerateMock<IPostRepository>();
			_sut = new EventPlugin(postRepository,
								   MockRepository.GenerateMock<IMapper<NameValueCollection, Settings>>(),
								   MockRepository.GenerateMock<IValidator<Settings>>())
			       {
			       	CategoryName = "Event category",
			       	LocationField = LocationField,
			       	LocationUnknownField = LocationUnknownField,
			       	RegistrationRecipientField = RegistrationRecipientField,
			       	MaximumNumberOfRegistrationsField = MaximumNumberOfRegistrationsField,
			       	DefaultLocation = DefaultLocation,
			       	DefaultRegistrationRecipient = DefaultRegistrationRecipient,
			       	DefaultMaximumNumberOfRegistrations = DefaultMaximumNumberOfRegistrations
			       };

			_post = new Post();

			postRepository.Stub(x => x.GetCategoryNameOf(_post)).Return(_sut.CategoryName);
		}
예제 #6
0
		protected override void Establish_context()
		{
			base.Establish_context();

			_sut = Container.Create<EventPlugin>();
			_sut.CategoryName = "Event category";

			_post = new Post();

			Container.Get<IPostRepository>().Stub(x => x.GetCategoryNameOf(_post)).Return(_sut.CategoryName);
			Container.Get<IEventValidator>().Stub(x => x.Validate(_post)).Return(new ValidationReport
			                                                                   {
			                                                                   	new ValidationError("something", "some field"),
			                                                                   	new ValidationError("some other thing")
			                                                                   });

			Mocks.ReplayAll();
		}