public void ToString_ValidString_ReturnMessage() { var message = new Message("Hello world!"); var text = message.ToString(); Assert.IsNotNull(text); }
private void Register(Message message, MessageType type) { ObjectParam(message); using (var connection = new SqlConnection(connectionString)) { connection.Open(); using (var command = new SqlCommand("usp_add_log", connection)) { command.CommandType = CommandType.StoredProcedure; command.Parameters.Add(new SqlParameter("@textLog", message.ToString())); command.Parameters.Add(new SqlParameter("@typeLog", (int)type)); command.ExecuteNonQuery(); } connection.Close(); } LastMessage = message; LastMessageType = type; }