public void GuessesTheImageTest_GuessesTheImages_Save_validModel() { var model = new GuessesTheImageToAdd { WordId = 1, Id = 1, Image = null }; var result = rep.Edit(model); Assert.AreEqual(true, result, string.Format("result != expected")); }
public bool Edit(GuessesTheImageToAdd image) { if (!image.Validate(false)) { throw new Exception("Invalid model"); } return(rep.Edit(image)); }
public void GuessesTheImageServiceTest_Edit_valid() { var model = new GuessesTheImageToAdd { Id = 5, Image = new Image { Data = "asdfasdfsafasf", Name = "asdf.jpg" }, WordId = 1 }; var expected = rep.Edit(model); var actual = service.Edit(model); Assert.AreEqual(expected, actual); }