public void DeleteReturnsNotFound() { // Arrange var mockRepository = new Mock <IKategorijaProizvodaRepository>(); var controller = new KategorijeController(mockRepository.Object); // Act IHttpActionResult actionResult = controller.Delete(10); // Assert Assert.IsInstanceOfType(actionResult, typeof(NotFoundResult)); }
public void DeleteReturnsOk() { // Arrange var mockRepository = new Mock <IKategorijaProizvodaRepository>(); mockRepository.Setup(x => x.GetById(10)).Returns(new KategorijaProizvoda { Id = 10 }); var controller = new KategorijeController(mockRepository.Object); // Act IHttpActionResult actionResult = controller.Delete(10); // Assert Assert.IsInstanceOfType(actionResult, typeof(OkResult)); }