public MerkModel Save(MerkModel merk) { // validasi var result = merk; result = TryValidate(merk); // save var dummyMerk = _merkDal.GetData(merk.MerkID); if (dummyMerk == null) { _merkDal.Insert(result); } else { _merkDal.Update(result); } return(result); }
public void GetData_ValidData_NoEx() { using (var trans = TransHelper.NewScope()) { // arrange var expected = MerkDataFactory(); _merkDal.Insert(expected); // act var actual = _merkDal.GetData("A1"); // assert actual.Should().BeEquivalentTo(expected); } }