public void Insert_ValidData_NoEx() { using (var trans = TransHelper.NewScope()) { // arrange var expected = ColorDataFactory(); // act _colorDal.Insert(expected); // assert } }
public ColorModel Save(ColorModel color) { // validasi var result = color; result = TryValidate(color); // save var dummyColor = _colorDal.GetData(color.ColorID); if (dummyColor == null) { _colorDal.Insert(result); } else { _colorDal.Update(result); } return(result); }
public IResult Insert(Color color) { _colorDal.Insert(color); return(new SuccessResult(Messages.ColorAdded)); }