public void Create_Producto_ReturnsBoolean() { ProductoController productcontroller = new ProductoController(true); RedirectToActionResult result = (RedirectToActionResult)productcontroller.Create(new Producto { IdProduct = 1, Name = "tenis", description = "bkjsbkajs", price = "500" }); Assert.AreEqual(true, true); }
private void CrearPostTestOk() { BasicConfigMockData(); controller = new ProductoController(_repositorio); var result = controller.Create(TestClientOK()) as PartialViewResult; result.Should().BeNull(); DbSetMock.Verify(s => s.Add(It.IsAny <Product>()), Times.Once()); webContextMock.Verify(c => c.SaveChanges(), Times.Once()); }
private void CrearTest() { BasicConfigMockData(); controller = new ProductoController(_repositorio); var result = controller.Create() as PartialViewResult; result.ViewName.Should().Be("_Create"); var personModelCreate = (Product)result.Model; personModelCreate.Should().NotBeNull(); }