public void DeleteSatisfactionConfig() { Home home; using (UserManager<Client, int> manager = new ClientUserManager(new CustomUserStore(ctx))) { ctx.HomeSet.Add(home = new Home() { Title = "LaCorderieTest", EstablishmentType = EEstablishmentType.BB, Client = manager.FindByEmail("*****@*****.**"), }); } SatisfactionConfig toAdd; repo.Add(toAdd = new SatisfactionConfig() { Home = home, Title = "ttt" }); repo.Save(); repo.Delete(toAdd); repo.Save(); Assert.IsNull(ctx.SatisfactionConfigSet.FirstOrDefault(p => p.Home.Id == home.Id)); Assert.IsNull(ctx.SatisfactionConfigQuestionSet.Include("SatisfactionConfig").FirstOrDefault(p => p.SatisfactionConfig.Id == toAdd.Id)); Assert.IsNotNull(ctx.HomeSet.FirstOrDefault(p => p.Title == home.Title)); }
public static List<System.Net.Mail.Attachment> GetAttachments(List<Document> attachmentList, Home currentHome) { List<System.Net.Mail.Attachment> attachments = new List<System.Net.Mail.Attachment>(); foreach (Document cur in attachmentList) attachments.Add(new Attachment(DocumentUtils.GetDocumentStream((bool)cur.IsPrivate, (string)cur.Url, currentHome.EncryptionPassword), (string)cur.Title)); return attachments; }
public void Init() { ctx = EFContext.CreateContext(); repo = new HomeRepository(ctx); repo.includes = new List<string>(); entity = new Home() { ClientId = 1, EstablishmentType = EEstablishmentType.BB, Title = "La corderie TEST" }; }