integration-testing

Implementing Repository pattern and doing Tests

三世轮回 提交于 2019-11-29 08:47:04
I have read almost all articles about Repository pattern and different implementations of it. Many of them judged bad practices (ex: using IQueryable<T> instead of IList<T> ) etc. that why i'm still stuck and couldn't end-up to the right one. So: Do I need Repository pattern to apply IoC in my MVVM applications ? If yes, What is the efficient IRepository implementation to EF Entities which is a good practice and better testable ? How can I test my Repositories and UnitofWork behavior ? Unit tests against in memory Repositories ? Integration tests ? Edit : According to answers I added the first

Making real requests to HTTP server in AngularJS unit/integration tests

浪子不回头ぞ 提交于 2019-11-29 07:54:00
Making a request that wasn't mocked with $httpBackend.when in Angular 1.x unit/integration test results in an error: Error: Unexpected request: GET /real-request Is it possible to make real HTTP requests with ngMock and Karma+Jasmine test rig? What is a good practice to do that? Estus Flask AngularJS is opinionated framework, and its opinion on HTTP requests in unit tests is that all of them should be mocked. It is not advisable to do real HTTP requests in unit tests for two reasons. Unit tests are supposed to be isolated and be fast. Making a real request makes a test asynchronous, which

How to make NUnit stop executing tests on first failure

二次信任 提交于 2019-11-29 05:52:49
We use NUnit to execute integration tests. These tests are very time consuming. Often the only way to detect a failure is on a timeout. I would like the tests to stop executing as soon as a single failure is detected. Is there a way to do this? This is probably not the ideal solution, but it does what you require i.e. Ignore remaining tests if a test has failed. [TestFixture] public class MyTests { [Test] public void Test1() { Ascertain(() => Assert.AreEqual(0, 1)); } [Test] public void Test2() { Ascertain(() => Assert.AreEqual(1, 1)); } private static void Ascertain( Action condition ) { try

Selenium: retrieve data that loads while scrolling down

六眼飞鱼酱① 提交于 2019-11-29 04:59:39
I'm trying to retrieve elements in a page that has an ajax-load scroll-down functionality alla Twitter. For some reason this isn't working properly. I added some print statements to debug it and I always get the same amount of items and then the function returns. What am I doing wrong here? wd = webdriver.Firefox() wd.implicitly_wait(3) def get_items(items): print len(items) wd.execute_script("window.scrollTo(0, document.body.scrollHeight);") # len(items) and len(wd.find_elements-by...()) both always seem to return the same number # if I were to start the loop with while True: it would work,

Automated test tools for Linux/ncurses

冷暖自知 提交于 2019-11-29 03:50:12
I've picked up a legacy application developed in C/C++ on Linux, using ncurses for UI. What automated testing tools are there for this environment? Edit: I've used AutomatedQA TestComplete in the past, and this is the type of tool I'm looking for - except running on Linux, and with the ability to test Text UI apps. I wrote something like that before. Not much docs, but you can try the code. It's written in Python and runs on Linux. You would basically need the ANSIterm filter , and the expect module . Then you compose them into a filter. You'll likely have to start the process with the

What best practices do you use for testing database queries?

大兔子大兔子 提交于 2019-11-29 03:01:14
问题 I'm currently in the process of testing our solution that has the whole "gamut" of layers: UI, Middle, and the omnipresent Database. Before my arrival on my current team, query testing was done by the testers manually crafting queries that would theoretically return a result set that the stored procedure should return based on various relevancy rules, sorting, what have you. This had the side effect of bugs being filed against the tester's query more often than against the actual query in

Chrome extension testing

戏子无情 提交于 2019-11-29 02:59:19
问题 Does anyone have experience with Chrome extension testing? For example: I want to create an extension that uses the popup browser action, and automate a test case that checks the behavior of the popup when clicked.[chromium issue] Perhaps you could use selenium (it would be really great if this is possible). 回答1: Have you considered using a general purpose GUI-testing tool? If you are looking for a free, basic solution, check out Sikuli. There is a bunch of similar tools out there. 回答2: I've

Do you separate your unit tests from your integration tests? [closed]

老子叫甜甜 提交于 2019-11-29 02:57:26
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 7 years ago . I was just wondering if anyone else just sees integration tests as just a special unit test. I have, however, heard from other

Integration test with IOptions<> in .NET Core

情到浓时终转凉″ 提交于 2019-11-29 02:18:14
I pass IOption<T> to my CommandBus so I can get the settings from my ServiceBusSetting class. I want to do an integration test of my Bus. I do not want to resolve it just use new QueueCommandBus and need to pass IOptions to it. var services = new ServiceCollection().AddOptions(); services.Configure<ServiceBusAppSettings>(Configuration.GetSection("ServiceBus")); var options = services.BuildServiceProvider().GetService<IOptions<ServiceBusAppSettings>>(); ////Act var commandBus = new QueueCommandBus(options); This works fine, but feels very complex code to get the IOptions<T> from my appsetting

How to order methods of execution using Visual Studio to do integration testing?

谁说我不能喝 提交于 2019-11-29 02:17:32
问题 I have 2 questions in regard doing integration testing using VS 2010 First, I'm really in need of finding a way to execute these testing methods in the order I want them to. Note: I know in Unit Testing, methods should run standalone from anything else, but these are integration tests which I do depend on the order of which method runs first. On the same note, is there a way to keep a local variable through running the tests? For example like the following code which right now fails.