integration-testing

How to break the database access class of a Repository

独自空忆成欢 提交于 2021-01-07 02:51:41
问题 I have the following tightly coupled database access class (repository), that is hard to unit test: class EmployeesRepository : IEmployeeRepository ... public IEnumerable<Employee> GetAllEmployees() { List<Employee> list = new List<Employee>(); try { string connectionString = _secureConfig.Value.MyDbSetting; string sql = "select id, firstname, lastname, entrydate, email from empoyees"; using SqlConnection connection = new SqlConnection(connectionString); using SqlCommand command = new

How do I run a maven plugin's integration tests?

核能气质少年 提交于 2021-01-04 20:27:49
问题 I've generated a maven plugin project using the maven-archetype-plugin archetype. I've altered the generated integration test src/it/simple-it/verify.groovy to fail: assert false I then invoked: $ mvn clean install invoker:integration-test invoker:verify And my assert false test passed: [INFO] Installing /home/peter/ownCloud/Personal/eclipse-workspace/my-plugin/target/my-plugin-1.0-SNAPSHOT.jar to /home/peter/.m2/repository/org/example/my-plugin/1.0-SNAPSHOT/my-plugin-1.0-SNAPSHOT.jar [INFO]

Maven integration-test doesn't find my class in same package structure

人盡茶涼 提交于 2020-12-30 02:15:56
问题 Here are my files: Pom parent: <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>my.group</groupId> <artifactId>my.artifact.pom</artifactId> <version>1.0-SNAPSHOT</version> <packaging>pom</packaging> <modules> <module>my.artifact.ws</module> </modules> <parent> <groupId>org.springframework.boot<

Maven integration-test doesn't find my class in same package structure

余生颓废 提交于 2020-12-30 02:05:31
问题 Here are my files: Pom parent: <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>my.group</groupId> <artifactId>my.artifact.pom</artifactId> <version>1.0-SNAPSHOT</version> <packaging>pom</packaging> <modules> <module>my.artifact.ws</module> </modules> <parent> <groupId>org.springframework.boot<

Integration testing ASP.NET Core with .NET Framework - can't find deps.json

独自空忆成欢 提交于 2020-12-29 05:30:03
问题 I have a ASP.NET Core Web API project targeting .NET Framework 4.7 that I'm trying to write integration tests for. I created a unit test project using Visual Studio Add new project and then the Unit Test Project (.NET Framework) template. I added the Microsoft.AspNetCore.Mvc.Testing NuGet package to the test project, and I have the following test: using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc.Testing; using Microsoft.VisualStudio.TestTools.UnitTesting; namespace TestRepro.Tests

Integration testing ASP.NET Core with .NET Framework - can't find deps.json

别说谁变了你拦得住时间么 提交于 2020-12-29 05:29:59
问题 I have a ASP.NET Core Web API project targeting .NET Framework 4.7 that I'm trying to write integration tests for. I created a unit test project using Visual Studio Add new project and then the Unit Test Project (.NET Framework) template. I added the Microsoft.AspNetCore.Mvc.Testing NuGet package to the test project, and I have the following test: using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc.Testing; using Microsoft.VisualStudio.TestTools.UnitTesting; namespace TestRepro.Tests

Integration testing ASP.NET Core with .NET Framework - can't find deps.json

吃可爱长大的小学妹 提交于 2020-12-29 05:29:38
问题 I have a ASP.NET Core Web API project targeting .NET Framework 4.7 that I'm trying to write integration tests for. I created a unit test project using Visual Studio Add new project and then the Unit Test Project (.NET Framework) template. I added the Microsoft.AspNetCore.Mvc.Testing NuGet package to the test project, and I have the following test: using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc.Testing; using Microsoft.VisualStudio.TestTools.UnitTesting; namespace TestRepro.Tests

How to make integration tests and unit tests run separately through maven?

我的未来我决定 提交于 2020-12-01 07:10:49
问题 Refer following links - GitHub discussion on how to separate Integration Tests and Unit Tests As a result, I tried this -- <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <configuration> <includes> <include>**/*Tests.java</include> <include>**/*Test.java</include> </includes> <excludes> <exclude>**/Abstract*.java</exclude> <exclude>**/IT*.java</exclude> <exclude>**/*IT.java</exclude> <exclude>**/*ITCase.java</exclude> <exclude>**/

How to make integration tests and unit tests run separately through maven?

房东的猫 提交于 2020-12-01 07:10:09
问题 Refer following links - GitHub discussion on how to separate Integration Tests and Unit Tests As a result, I tried this -- <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <configuration> <includes> <include>**/*Tests.java</include> <include>**/*Test.java</include> </includes> <excludes> <exclude>**/Abstract*.java</exclude> <exclude>**/IT*.java</exclude> <exclude>**/*IT.java</exclude> <exclude>**/*ITCase.java</exclude> <exclude>**/