private void PersistMessage(MessageTable message) { MessagePersistant messagePersistant = new MessagePersistant(null, DatabaseOptionConfigRetriever.DatabaseOptionAppSetting); messagePersistant.AddToPending(message); messagePersistant.SaveChange(); }
//[TestMethod] public void CreateMessageMYSql() { Random randomNumber = new Random(); string messagetext = "Unit test message. Hello for the " + randomNumber.Next(1000000) + " time."; MessageTable message = new MessageTable() { MessageText = messagetext, MessageCreated = DateTime.Now, SenderId = 1 }; MessagePersistant createMessage = new MessagePersistant(null, DbContextConstant.MySqlDbContext); createMessage.AddToPending(message); createMessage.SaveChange(); }