Unit testing involving hardware communication worth it? [closed] - c#

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 3 years ago.
Improve this question
I am developing a C# application that involves communication with hardware devices such as an NFC reader and Spectrometer. We have the hardware already and I am not sure if it is still worth the time converting the hardware into mock classes. I am thinking of testing the software functions together with the hardware device.
Is there still any benefit conducting unit tests without hardware? Currently i do not have the interfaces for the different hardware classes. It would seem to require some work to properly configure the hardware interface classes.
I am using DLLImports for the hardware communication. I’m not sure if im able to simulate these dll calls using a fake class as well ?

Testing communication with the actual hardware device would become a Integration Testing but you are more inclined towards performing an Unit Test. I would say you just test the unit (method) that does communicate with the H/W piece and assert accordingly.

Related

Create a data tier in legacy C# application [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
Subjective question I know....
We have an existing application that has around 20 components that connect to a database. We are now clustering the application to increase scalability but we're hitting some limits where every process having a small connection pool is resulting in many connections to the DB. There would also be some interesting options for caching across our cluster if we could centralise connections.
My question is are there any low cost/risk options to refactor our solution from utilising SQL connections directly to a middle tier? Is the pain of this worth rewriting a full unit of work + models style application tier and refactoring all our database connections into the WCF business logic calls?
As a longer term solution refactoring to a middle tier would be helpful in that any common connection handling logic can be centralized. One common reason for the multiple connection problem is that connections are not disposed of correctly but it's speculation without looking at the code.
See the following from the sql support team for diagnosing multiple connection issues http://blogs.msdn.com/b/sql_pfe_blog/archive/2013/10/08/connection-pooling-for-the-sql-server-dba.aspx

How to start fitnesse tests from ms test [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I can see that it can be done from JUnit,
I would like to run it from ms test framework instead.
It is probably very similar.
thanks
Kenneth
There is no FitNesse runner for MSTest at this time. The biggest hurdle is that the FitNesse test engine is written in Java and was therefore easier to integrate with JUnit. To do the same with MSTest would require porting significant portions of Java code to .NET. If there is widespread demand for this, open source developers may be encouraged to work on it.
I am/was thinking that the easiest would be to write a unit test suite, containing a testmethod that starts fitness up as in another process. I.e. run it from command line and getting the result from the output file.
not a ver unit testing way, since it is slow. It sound more like an integration test.

How to create an addin within the existing windows application? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
There is a big windows application in which we also have WPF, I need to create an addin so that i can move my hige client to small addins. Problem is i need to pass commands or want to talk to other windows of the existing application from the addin. I have tried plugins which i have loaded through reflection. but how do i communicate to the other windows of the existing application?
You don't communicate with other windows directly. If you need an architecture like this, have a look at Prism for instance. And for communication between modules/add-ins you either use some sort of events (Prism has EventAggregator) or you provide interfaces in a project common to all other projects, and use dependency injection like MEF to provide modules with implementations of those interfaces. I know this is a very broead answer and you'll stil have to learn a lot, but your question is equally broad and there's just no way you can learn how to deal with large scalable applications in one-two-three. Or a couple of days/weeks.

BizTalk 2003 to AppFabric migration or move to BizTalk 2013 [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
We're a development dept that have 'inherited' a large BizTalk based middle-ware system (100+ orchestrations that run a large number of financial transactions).
The system is based on BizTalk 2003 which is now reaching end of life and our systems team want to can it.
Is is possible to migrate from BizTalk 2003/2004 to Appfabric?
I presume if we took this approach we'd have to re-develop the orchestrations to Windows Workflow (which we already use)
Or is a migration to BizTalk 2013 an better (easier) option?
Has anyone come across this situation before?
Thanks
Steve.
The two pieces of software have nothing in common, except that they both use the WF libraries.
AppFabric is a set of services, one of which is to host WF workflows. The workflows themselves are plain low-level WF4 workflows. No special activities or adapters to other systems like Biztalk.
BizTalk is a server product with rules, adapters to various systems, able to read various business process languages, define orchestrations at a high level,etc, etc
It's almost like comparing IL to LINQ. Yes, there is common ground but not much.

Why should one unit test MVC routes? [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
I see that people have ask more specific questions, but mine is broad, why should one test any routes at all? where does the benefit of this really shine? Thanks!
PS currently doing this in .Net C# MVC 3
Just my 2¢ to a very subjective question:
Because by unit testing your routes, a single key combination (that will run the unit tests) allows you to verify whether they behave as expected in contrast to running through your entire application and manually testing them by wasting enormous time and by potenatially forgetting to manually test some of the edge cases. Also when some other developer inherits the code base and starts modifying it, it is much easier for him to run this same key combination (that runs the unit tests) and get instant feedback whether his modifications didn't have some impact on the existing functionality rather than manually going through the entire application and clicking through all the links and stuff.
And from practical point of view I use MvcContrib TestHelper to unit test my routes.

Categories