public void Get_ShouldReturnAllBrandsAndTotalProducts() { //Arrange var mock = new Mock <IBrandService>(); var controller = new BrandsController(mock.Object); //Act mock.Setup(p => p.GetBrandsAndTotalProducts()); var result = controller.GetBrandsAndTotalProducts() as OkObjectResult; // Assert Assert.IsNotNull(result); Assert.AreEqual(200, result.StatusCode); }