Exemplo n.º 1
0
 public void GetApplicableLinks_WithConfiguredType_ReturnLinkBuilders()
 {
     _sut.Configure <HateoasSample>(source =>
     {
         source.AddLink("test")
         .When(x => x.Id != null && x.Id != Guid.Empty)
         .HasRouteData(x => new { id = x.Id });
     }).GetApplicableLinkBuilders(new HateoasSample())
     .Should().NotBeNull().And.NotBeEmpty();
 }
Exemplo n.º 2
0
        public void HasResource_WithValidType_ReturnTrue <T>(T valid) where T : class
        {
            // arrange
            var hateoasContext = _sut.Configure <T>(resource => { });

            // act
            var actual = _sut.HasResource(valid.GetType());

            // assert
            Assert.Same(_sut, hateoasContext);
            Assert.True(actual);
        }