integration-testing

XUnit Net Core Web API Integration Test: “The ConnectionString property has not been initialized.”

不羁的心 提交于 2020-01-06 08:46:15
问题 Just trying to build an Integration Test project for a NET Core Web API. So I've followed a few examples, including this one (https://dotnetcorecentral.com/blog/asp-net-core-web-api-integration-testing-with-xunit/) and naturally, I run into issues. When I run the simple GET test I get an exception: "System.InvalidOperationException : The ConnectionString property has not been initialized." Any help would be appreciated. 回答1: For server = new TestServer(new WebHostBuilder().UseStartup<Startup>

Unit testing RxJava in MVP presenter in android

落爺英雄遲暮 提交于 2020-01-06 07:15:15
问题 I am new to TDD. Also new to MVP and Rxjava. I just dive into it and It is worth it. But I stuck at the testing part. I understand the basis of unit testing. It is a little bit difficult for me in beginning. But I stuck here and So how can test the presenter? Here is the Presenter class - public class NewsPresenter { private final RxjavaService service; private final MainView view; private CompositeSubscription subscriptions; public NewsPresenter(RxjavaService service, MainView view) { this

Unit testing RxJava in MVP presenter in android

吃可爱长大的小学妹 提交于 2020-01-06 07:15:10
问题 I am new to TDD. Also new to MVP and Rxjava. I just dive into it and It is worth it. But I stuck at the testing part. I understand the basis of unit testing. It is a little bit difficult for me in beginning. But I stuck here and So how can test the presenter? Here is the Presenter class - public class NewsPresenter { private final RxjavaService service; private final MainView view; private CompositeSubscription subscriptions; public NewsPresenter(RxjavaService service, MainView view) { this

Integration tests who download files

浪尽此生 提交于 2020-01-06 06:09:03
问题 I am developing a web app who does some work, pack the data in a file and gives you back that file ( Content-Type: application/force-download ). Right now I am implementing some integration tests, where I ask for data and web app gives me back the file. Web app behaves correctly when test downloads expected data. I read this and I found it very inspiring but is that response valid when you build the file you want to download? 回答1: There are several approaches you can take. In order from best

Simulate a ember-select2 selection in ember integration test

喜夏-厌秋 提交于 2020-01-05 08:32:25
问题 Has anyone been able to simulate a select2 selection of an option? So far I've tried this: test("Checking navigation", function () { expect(1); visit("/hub"); click("#btnLogin"); andThen(function () { click(".select2-container"); andThen(function () { }); }); }); But I have not seen changes in the UI. 回答1: We need to hit the anchor inside the container Ember.$(" .select2-container a").trigger({type:'mousedown', which:1}); If you want to select an item in the dropdown you can do: Ember.$("

Grails integration test - domain object equality

北城余情 提交于 2020-01-05 08:17:53
问题 Setting up some integration tests, I'm having issues with domain class equality. The equality works as expected during normal execution, but when testing the Service methods through an integration test, the test for equality is coming back false. One service (called in the setUp() of the Test Case) puts a Domain object into the session SomeService { setSessionVehicle(String name) { Vehicle vehicle = Vehicle.findByName(name) session.setAttribute("SessionVehicle", vehicle) } getSessionVehicle()

ember integration test error. dealing with asynchronous side-effects

放肆的年华 提交于 2020-01-05 07:51:00
问题 I'm trying ember's integration testing package (http://emberjs.com/guides/testing/integration/) but I am getting this error Assertion Failed: You have turned on testing mode, which disabled the run-loop's autorun. You will need to wrap any code with asynchronous side-effects in an Ember.run I've made a JSBin to reproduce this error: http://jsbin.com/InONiLe/9, which we can see by opening up the browser's console. I believe what's causing this error is the line data.set('isLoaded', true); in

ember integration test error. dealing with asynchronous side-effects

岁酱吖の 提交于 2020-01-05 07:49:54
问题 I'm trying ember's integration testing package (http://emberjs.com/guides/testing/integration/) but I am getting this error Assertion Failed: You have turned on testing mode, which disabled the run-loop's autorun. You will need to wrap any code with asynchronous side-effects in an Ember.run I've made a JSBin to reproduce this error: http://jsbin.com/InONiLe/9, which we can see by opening up the browser's console. I believe what's causing this error is the line data.set('isLoaded', true); in

Spring/Spock - integration test of authentication

家住魔仙堡 提交于 2020-01-05 05:31:10
问题 I want to test protected endpoints in my application and I would like login before each test, get token and use this token in next tests. @ContextConfiguration @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) @Stepwise class IntegrationSpec extends Specification { @Autowired private TestRestTemplate rest @Autowired private String token @Shared private HttpEntity request def setup() { UserData userData = new UserData("Username", "Password"); def response = rest

Using Effort (EF Testing Tool) with Computed Column

一个人想着一个人 提交于 2020-01-04 04:15:11
问题 I have a number of integration tests which access the DB directly - create test prerequisite objects - performs the tests and then cleans up afterwards - however I wonted to try out the same approach in-memory. I have just used Effort in my project and it works very easily. However I've hit a problem that I have been trying - but unable to solve. One of the tables that I need filled up with dummy data - as a test prerequisite - contains a computed column (nvarchar, not null). For the scope of