public void AddWordSaveCrit() { var crit = new Estimator() { Description = "1" }; var w = new Word("1"); var w2 = new Word("2"); crit.SetWords(new[] { w, w2 }); session.DoSave(crit); var dbCrit = session.Get <Estimator>(crit.Id); var dbCritWords = session.QueryOver <CritWords>().List(); Assert.IsTrue(dbCrit.Words.Contains(w)); Assert.IsTrue(dbCrit.Words.Contains(w2)); Assert.IsTrue(dbCritWords.Count >= 2); }
protected override void OnOk() { var opt = QueryEditor.GetOptions(); estimator.Options = loader.WriteOptions(opt); estimator.OptionsFormat = loader.Format; var words = opt.GetAllWords().ToArray(); estimator.SetWords(words); (estimator as IEditableObject).EndEdit(); if (AuthorityController.CurrentDoctor != null) { AuthorityController.CurrentDoctor.AddWords(words); } Session.DoSave(words); Session.DoSave(estimator); }