Tag:unit testing

  • Spring boot 2. X basic tutorial: building restful API and unit test


    First, review and detail [email protected]、@RestController、@RequestMappingAnnotations. If you are not familiar with spring MVC and haven’t tried the quick start case, it is recommended to take a look at the contents of the quick start first. @Controller: decorated class, used to create an object to process HTTP requests @RestController: comments added after spring 4, originally [email protected] […]

  • Spring boot project uses junit5 unit test to report errors on idea


    Problem description Build the project with spring boot 2.2. X, and configure the POM file as follows: <properties> <java.version>1.8</java.version> </properties> <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.2.1.RELEASE</version> </parent> <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>com.jayway.jsonpath</groupId> <artifactId>json-path</artifactId> <scope>test</scope> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> </plugin> </plugins> </build>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> </plugin> </plugins></build> Unit test code […]

  • How to use Jacobo to analyze Java unit test coverage


    Preface With the popularity of agile development, writing unit tests has become a consensus in the industry. But how to measure the quality of unit testing? Some managers blindly pursue the number of unit tests, which leads to opportunistic developers to write a large number of repeated tests. When the number goes up, the quality […]

  • 1. Vue introduction


    1、VUEbrief introduction       Recently,WebThere are many front-end areasMVVMFramework technology, such asAngularJS、React,VUE.jsWait.       Vue.jsDraw lessons fromAngularJSThe design concept ofReactandAngularJSLesson,VUEDesigned as a lightweightMVVMFramework, clear documents, easy to learn, popular with front-end developers.       VueThrough a simpleAPITo provide reactive data binding and composable and reusable view components,It’s not a big, holistic framework.      VueIt is aMVVMThe implementation of the framework only provides […]

  • How to unit test C project in VS


    scene Spring boot + JUnit implements unit test of querying database in idea: https://blog.csdn.net/BADAO_LIUMANG_QIZHI/article/details/92780716 How to use junit4 + spring test to write unit tests in SSM: https://blog.csdn.net/BADAO_LIUMANG_QIZHI/article/details/85112004 Realize paging and JUnit unit test in SSM: https://blog.csdn.net/BADAO_LIUMANG_QIZHI/article/details/85113289 In Java, refer to the above for unit testing, then under the. Net platform, how to use VS […]

  • Explain. Net unit test method in detail


    1. Abnormal test It can be used to test method exceptions directly or to test simulation objects. However, it is rarely used to test simulation objects. Therefore, this paper introduces the method exception test. Please see the following code. When the user name is empty, an exception will be thrown. for example public bool Valid(string […]

  • Jest describe wait, group test asynchronous request beforeall + describe + test + Promise


    For group testing of asynchronous requests, no relevant examples were found in the official documents, so we could only cross the river by feeling stones and stepping on many pits. Finally, we found that the original correct posture was this paper: global.fetch = require(‘node-fetch’); import api from ‘../../api’ let res= {}; beforeAll(async () => { […]

  • IOS unit test details


    It seems that this star was not last nightFor whom the wind stands Preface In the process of componentization, we need to dismantle the components. We can divide the modules in our project into basic components, functional components and business components. However, problems will occur easily in the process of splitting. Therefore, we add unit […]

  • On the reconstruction and test of the project


    This article is from my blog. You are welcome to visit it when you are free.~ background In recent months, I have developed a restful web service in the company. At first, when selecting technology, I adoptedflaskFrame. Although flask is a synchronous framework, it can cooperate withgeventOr other ways to run in an asynchronous container […]

  • Teach you to write a unit test that machine learning code can also use


    Abstract:Do you want to save time retraining data? Do you want to make a qualitative leap in your research results? Take a look at these unit tests to help you. Note:This article has been praised and concerned by readers since it was published. Therefore, I have compiled a machine learning test library. Please click the […]

  • What did Ali technicians do in their first lesson?


    From Source Code to Upline It’s not easy. What is procedure? Or what is software? There seems to be ambiguity in this. Sometimes it refers to the source code, sometimes it refers to the installation package or CD-ROM, such as “I downloaded a software”. Sometimes it refers to programs that are ready to run at […]

  • Android-Unit Testing


    Android unit testing has two ways:Local unit testingandEquipment Unit Testing,Local unit testingIt can run directly on the local machine.Java Virtual Machine(JVM)。 It is characterized by short running time and high execution efficiency, but it does not.Android frameworkSupport, each file can be tested separately.On Android devices, unit testing runs a separate APK that runs directly on […]