Exemple #1
0
        public void ShouldGetLinksToSelfRouteAndPiints()
        {
            // Arrange
            var controller = new RootController();

            // Act
            var result = controller.GetRoot();

            // Assert
            var isOk           = result is OkObjectResult;
            var rootResponse   = (result as OkObjectResult)?.Value;
            var isRootResponse = rootResponse is RootResponse;

            Assert.IsNotNull(result);
            Assert.IsTrue(isOk);
            Assert.IsNotNull(rootResponse);
            Assert.IsTrue(isRootResponse);
        }
        public void ReturnNoContentWhenNotHateoasMediaType()
        {
            var result = _sut.GetRoot("application/json");

            Assert.IsType <NoContentResult>(result);
        }