public void the_url_should_start_with_the_url_for_the_grid_name_and_model() { var expected = theUrls.UrlFor(new LookupRequest() { GridName = "TheTest" }); theResultingUrl.ShouldStartWith(expected); }
public void create_a_link() { var expression = new LinkExpression(x => x.UrlFor(new SomeLinkInput())) .Rel("some rel"); var urls = new StubUrlRegistry(); var link = expression.As<ILinkCreator>().CreateLink(urls); link.Url.ShouldBe(urls.UrlFor(new SomeLinkInput())); link.Rel.ShouldBe("some rel"); }
public void create_a_link() { var expression = new LinkExpression(x => x.UrlFor(new SomeLinkInput())) .Rel("some rel"); var urls = new StubUrlRegistry(); var link = expression.As <ILinkCreator>().CreateLink(urls); link.Url.ShouldBe(urls.UrlFor(new SomeLinkInput())); link.Rel.ShouldBe("some rel"); }
public void write_url_for_model() { var urls = new StubUrlRegistry(); var services = MockRepository.GenerateMock <IServiceLocator>(); services.Stub(x => x.GetInstance <IUrlRegistry>()).Return(urls); theAccessorProjection.WriteUrlFor(age => new CreateValueTarget { Name = age.ToString() }); var expectedUrl = urls.UrlFor(new CreateValueTarget { Name = "37" }); theAccessorProjection.As <IProjection <ValueTarget> >().Write(new ProjectionContext <ValueTarget>(services, _theValues), theMediaNode); theMediaNode.Element.GetAttribute("Age").ShouldEqual(expectedUrl); }
public void write_url_for_model() { var urls = new StubUrlRegistry(); var services = MockRepository.GenerateMock<IServiceLocator>(); services.Stub(x => x.GetInstance<IUrlRegistry>()).Return(urls); theAccessorProjection.WriteUrlFor(age => new CreateValueTarget{ Name = age.ToString() }); var expectedUrl = urls.UrlFor(new CreateValueTarget{ Name = "37" }); theAccessorProjection.Write(new ProjectionContext<ValueTarget>(services, _theValues), theMediaNode); theMediaNode.Element.GetAttribute("Age").ShouldEqual(expectedUrl); }
public void sets_the_report_url() { theLog.ReportUrl.ShouldEqual(theUrls.UrlFor(theLog)); }