Tag:Test function

  • C ා concurrent queue


    Test function static async Task RunProgram(){ var taskQueue = new ConcurrentQueue(); var cts = new CancellationTokenSource();//Build task added to concurrent queue var taskSource = Task.Run(() => TaskProducer(taskQueue));//Start four tasks simultaneously to process the tasks in the queue Task[] processors = new Task[4]; for(int i =1;i <= 4; i++) { string processId = i.ToString(); processors[i – […]

  • Brief introduction of golang unit testing


    There is built-in support for unit testing in golang. It is not necessary to introduce a third-party jar like Java to carry out testing. The following will introduce several tests supported by golang; 1、 Test type There are three kinds of unit tests in golang: function test, benchmark test, sample test or sample function;   the […]

  • Goweb MySQL connection


    Operation database The database / SQL package in go language defines a series of operations on database. database/sql/driverThe package defines the interfaces that should be implemented by the database driver, and these interfaces will be used by the SQL package. But go didn’t mention itFor any official database driver, so we need to import a […]

  • Array of ES6


    1、 When it comes to arrays, it can be said that we have the longest interaction in our daily work. We deal with the data returned by the back end. Today’s main content is about: 1. What are ES6 and Es5 arrays traversal? What are the advantages and disadvantages? Which is the better way? 2. […]

  • Probably the hottest third-party open source testing framework in Python pytest


    By hellogithub-Prodesire The sample code involved in this article has been synchronously updated to the hellogithub team warehouse I. Introduction This article is the third part of “talking about Python’s unit test framework”. The first two parts respectively introduce the standard library unittest and the third-party unit test framework nose. As the last part of […]

  • Android shared preferences


    Complete reading and writing of shared parameters public class SharedPreference { private Context context; public SharedPreference(Context context) { // TODO Auto-generated constructor stub this.context = context; } public boolean saveMessage(String name, String passwd) { boolean flag = false; //Save as userinfo.xml automatically SharedPreferences sharedPreferences = context.getSharedPreferences(“userinfo”, Context.MODE_PRIVATE); //Edit data SharedPreferences.Editor editor = sharedPreferences.edit(); editor.putString(“name”, name); […]