public void GetByBlogIdNegative() { var repo = new Mock <BlogRepository>(db); BlogsController controller = new BlogsController(repo.Object); var data = controller.Get(4); var result = data as ObjectResult; Assert.AreEqual(400, result.StatusCode); }
public void GET_BLOG() { // arrange var mock = new Mock <IBlog>(); mock.Setup(b => b.Get()).Returns(_blogModel); var controller = new BlogsController(mock.Object); // act var result = controller.Get(); result.Should().NotBeNull(); }
public void BlogControllerGet() { var results = _ctrl.Get(0, 0); Assert.IsTrue(results.Any()); }
public void Test1() { var results = _controller.Get(); Assert.Equal(1, results.Count()); }