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 void GetData_ValidData_NoEx() { using (var trans = TransHelper.NewScope()) { // arrange var expected = ColorDataFactory(); _colorDal.Insert(expected); // act var actual = _colorDal.GetData("A1"); // assert actual.Should().BeEquivalentTo(expected); } }