private static DeveloperCreateEditViewModel FillModel(Developer model) { var service = new AchievementIssuerService(); var issuers = service.GetAllAchievementIssuers(); foreach (var issuer in issuers) { model.AddAccountAtIssuer(new DeveloperAccountAtIssuer(issuer.Id, "")); } model.AccountsAtIssuers = model.AccountsAtIssuers.OrderBy(a => a.AchievementIssuerId).ToList(); return(AutoMapper.Mapper.Map <DeveloperCreateEditViewModel> (model)); }
public void SaveDeveloper_DeveloperDoesNotExists_Created() { var developer = new Developer() { Id = 5L, Username = "******", FullName = "test", Email = "*****@*****.**" }; developer.AddAccountAtIssuer(new DeveloperAccountAtIssuer() { Username = "******", AchievementIssuerId = 1 }); m_target.SaveDeveloper(developer); Assert.AreEqual(5, m_target.CountAllDevelopers()); Assert.AreEqual(5L, m_target.GetDeveloperById(developer.Id).Id); }