public void AddNewMessage(MessageFromCompanyModel messageModel) { try { MessageDAL.AddNewMessage(messageModel); } catch (Exception e) { } }
public void AddNewMessageToBuliding(MessageFromCompanyModel messageModel) { try { MessageDAL messageDAL = new MessageDAL(); messageDAL.AddNewMessage(messageModel); } catch (Exception e) { } }
public void AddNewMessage(MessageFromCompanyModel messageModel) { try { MessageDAL messageDAL = new MessageDAL(); messageDAL.AddNewMessage(messageModel); } catch (Exception e) { throw new Exception(e.Message); } }
public void AddNewMessageTest() { MessageFromCompanyModel model = new MessageFromCompanyModel(); model.Subject = "TestMessage"; model.Text = "TestValue"; CompanyDAL companyDAL = new CompanyDAL(); model.CompanyId = companyDAL.GetCompanies().Select(x => x.Id).Min(); MessageDAL messageDAL = new MessageDAL(); messageDAL.AddNewMessage(model); MessageFromCompanyModel testmodel = messageDAL.GetMessagesByCompany(model.CompanyId).Where(x => x.Subject == "TestMessage" && x.Text == "TestValue").FirstOrDefault(); Assert.That(testmodel != null, Is.True); }