public Sport Add(Sport sport) { if (Exists(sport.Name)) { throw new SportAlreadyExistsException(); } SportEntity entity = mapper.ToEntity(sport); context.Entry(entity).State = EntityState.Added; context.SaveChanges(); return(mapper.ToSport(entity)); }
public void SportToEntityNameTest() { SportEntity converted = testMapper.ToEntity(sport.Object); Assert.AreEqual(converted.Name, entity.Name); }