Esempio n. 1
0
 public override void AddHypermediaLinks(HypermediaBuilder builder)
 {
     Add(new Link()
     {
         Rel = "self", Href = new Uri("https://testgenericlinkmodel.test.com")
     });
 }
Esempio n. 2
0
        public void AddDuplicateKeyTest()
        {
            var    builder = new HypermediaBuilder();
            var    model   = new DuplicateKeyModel();
            Action act     = () => model.AddHypermediaLinks(builder);

            Assert.Throws <ArgumentException>(act);
        }
Esempio n. 3
0
        public void AddModelLinkTest()
        {
            var builder = new HypermediaBuilder();
            var model   = new LinkTestModel()
            {
                MoqModel = new MoqHyperlinkModel()
            };

            model.AddHyperMediaSupportLinks(builder);
            Assert.Equal(model.Links.Count(), 1);

            Assert.Equal(model.MoqModel.Links.Count(), 1);
        }
 public HypermediaBuilderTests()
 {
     mockDocument = new Mock <IHypermediaDocument>();
     sut          = new HypermediaBuilder <IHypermediaDocument>(Mock.Of <IHypermediaService>(), mockDocument.Object);
 }
Esempio n. 5
0
 public override void AddHypermediaLinks(HypermediaBuilder builder)
 {
     Add(builder.FormConfiguration("modeltest", new { Id = 1 }).Build().AddSelfRel());
 }
Esempio n. 6
0
 public override void AddHypermediaLinks(HypermediaBuilder builder)
 {
     throw new NotImplementedException();
 }
Esempio n. 7
0
 public override void AddHypermediaLinks(HypermediaBuilder builder)
 {
     Add(builder.FromController <FakeController>(c => nameof(c.GetCollectionModel), values: new { id = Id, name = Name }).Build().AddSelfRel());
     Add(builder.FormConfiguration("modeltest", new { id = 1 }).Build().AddRel("modeltest"));
 }
Esempio n. 8
0
 public override void AddHypermediaLinks(HypermediaBuilder builder)
 {
     Add(builder.FromController <FakeController>(c => nameof(c.GetSimpleModel), new { id = Id, name = Name }).Type("GET").Build().AddSelfRel());
 }
Esempio n. 9
0
 public override void AddHypermediaLinks(HypermediaBuilder builder)
 {
     Add(builder.Fromtemplate(template: "/genericlist", uri: new Uri("https://templatetest.com")).Build().AddSelfRel());
 }
Esempio n. 10
0
 public override void AddHypermediaLinks(HypermediaBuilder builder)
 {
     Add(builder.Fromtemplate("/moq/{id}/items", new { id = Id }, uri: new Uri("https://templatetest.com")).Build().AddSelfRel());
 }