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 EntityToSportNameTest() { Sport converted = testMapper.ToSport(entity); Assert.AreEqual(converted.Name, sport.Object.Name); }