コード例 #1
0
		public FubuContinuation Post(AboutUpdateModel model)
		{
			var dto = new AboutInfoDto {AboutText = model.AboutText_BigText, ThingsILikeUrls = model.ThingsILikeUrls.ToStrings()};
			updater.Update(dto);

			return FubuContinuation.RedirectTo<ViewEndpoint>(x => x.Get(new AboutLinkModel()));
		}
コード例 #2
0
		public void No_http_allowed_in_things_I_like_urls()
		{
			var urls = new List<StringWrapper>
			           	{
							new StringWrapper{Text = "http://www.bbc.co.uk"}
			           	};
			var model = new AboutUpdateModel {ThingsILikeUrls = urls};

			var val = Validator.BasicValidator().Validate(model);

			var err = val.MessagesFor<AboutUpdateModel>(m => m.ThingsILikeUrls);

			Assert.That(err.ElementAt(0).GetMessage(), Is.EqualTo("http:// is not a valid prefix for \"Things I Like Urls\""));
		}