VS for Mac - Am I working on code covered by unit tests? - visual-studio-mac

On regular VS, using a enterprise licence, there's a little annotation above the method declaration which says something like "passing 12/15".
Is there a way to discover if I'm altering a code that is being covered by unit tests on VS for Mac?

Related

How I do I automate Xamarin.iOS unit test project

How I do I automate Xamarin.iOS unit test project.
For Android, I found this link which worked fine.
https://developer.xamarin.com/guides/android/troubleshooting/questions/automate-android-nunit-test/
Is there any references like this for Xamarin.iOS too?
At the time of writing this, I don't believe what you'd like to do is possible. If I take your meaning, you'd probably like to say "Run All" with some test runner (presumably in XS or VS) and then get the results immediately, but that's not how it works with Xamarin.iOS. I'm sure you've already glanced at Xamarin's iOS testing quick-start, but if not here that is.
You have to set up a Unit Test app that uses the Touch.Unit framework, fire up the test app, and "touch" the tests you'd like to run. My experience doing this has not been so great. The runner itself seems buggy and you're limited with in what other tools you can use (e.g., mocking frameworks won't work, assertions made with Shouldly won't register). I guess it's better than nothing, though!

Framework for unit test case in titanium appcelerator

Any frameworks available for writing test cases to Support iOS applications developed using Appcelerator Titanium?
There are quite a few frameworks for Unit Testing:
MockTi
Titanium-Jasmine
Ti-Mocha
Ti02
TiUnit
TiShadow
But the most of those frameworks listed above are either discontinued or don’t work anymore. And the frameworks that are still working mostly run in the Titanium container/runtime. This means the Titanium project needs to be build and run first which makes the execution process of your tests very slow. Besides that, most of them don’t provide mocking the Titanium namespace (e.g. manipulating/mocking Ti.Network).
We’re using the TiUnit toolset for our Unit Testing in combination with Istanbul (test/code coverage). TiUnit covers our needs within Unit Testing:
Fast and execution outside of the Titanium container/runtime
Mocking all dependencies (e.g. required CommonJS modules)
Generating a mock for all functions, constants and properties in the
Ti namespace (Ti)
Callback, L macro and $ testing
More information can be found on the TiUnit github page
We recommend ti-mocha (https://github.com/tonylukasavage/ti-mocha) which suited, test cases, supports asserts, skips, advanced validations and many more features.

What do I need to start using specflow

I'm trying to use SpecFlow for a .net project. I'm new to SpecFlow. The Development team are using NUnit, so it would seem that SpecFlow would be a good option in conjunction with Cucumber. However, the Development team have come back say that SpecFlow cannot be used saying they do not have an API/Service that is available to use at the level required. Currently all of their automated tests are through the UI using Test Complete, I am keen to move to API level testing.
Can anyone explain to me why SpecFlow cannot be used, I'm sorry it's a newbie question but no one can answer it, I've asked everyone I can think of, surely the first steps would be to see if we can use SpecFlow with NUnit but perhaps not.
Can anyone give me a guide on my next steps, how can I be sure this isn't an option without righting it off without concern that it's just being blocked?
Thank you
SpecFlow has a unit test generator that generates unit test code for a variety of unit test frameworks. SpecFlow generates NUnit tests in its default configuration. The getting started page on specflow.org explains a quick way to get up and running with SpecFlow and NUnit, http://www.specflow.org/getting-started/.
If the UI is HTTP based, SpecFlow can be used with WebDriver or another browser automation framework to test the UI. This blog post provides an overview of how to get started with SpecFlow, NUnit and WebDriver, http://blogs.lessthandot.com/index.php/enterprisedev/application-lifecycle-management/using-specflow-to/
I am unclear on the API you want to test. If you could provide more information on the specific API and UI you are trying to test, I could possibly provide some code examples or references for you.
Is the API exposed through HTTP?
Is the UI a web, mobile, or desktop
application?
Have you tried to use SpecFlow at all?
SpecFlow doesn't run tests. It simply maps readable language to tests. If their test can be written as a nunit test, then SpecFlow is available to you to use. With no change, here is how it would look.
Scenario: Running 'testname'
Then I execute the test 'TestName'
You would map that to
[Then(#"I execute the test '(.*)'")]
public void ExecuteSpecificTest(string testname)
{
// Using reflection, execute the method listed
}
Obviously you would want to do better than that. You want a given, when, then so you clearly show the setup, action, and then compare expected verses actual result but it isn't necessary. Best practices however is another discussion.
To sum it up, code is code and SpecFlow simply maps to code. You can use WatiN, WebDriver, or anything else to hook into the UI or an API. SpecFlow doesn't care. It simple executes the methods without knowing what's inside.

test automation with Xcode for ios

I want to use Xcode for test automation. Please help me how can I use? Likewise we use selenium driver in Microsoft visual studio, similarly what’s the procedure for creating test automation for ios app.
Alike we write scenarios and its implementation in MS Visual Studio using Spec flow. I want to do same for iPhone. Need help.
I have googled but I’m still confused what exactly it would need?
I know 3 framework to test automation for you:
KIF: It's write by Objective-C. And easily to use if you familiar with Objective-C language.
Frank: It's write by Ruby. I haven't use it much, but I have try and it have less gestures.
UI Automation: It's simple, easy and integrate with XCode. And use Javascript to write. If you write a simple testcase, you don't need code, it will record your touch automatically.

DUnit Testing in a Midas/DataSnap project

How does one setup DUnit Testing in a Midas/DataSnap project in Delphi 2006
Edit
How does one set up a Dunit Test into a TRemoteDataModule
The project wizard in Delphi 2006 does not work with TRemoteDataModule
The question doesn't entirely make sense. Unit tests are performed in a separate project, not within your DataSnap server. Generally, tests which connect to a database are integration tests rather than unit tests. What is it, exactly that you want to test? If it's utility methods within, say, a TRemoteDataModule, you should extract those out into a separate class as class methods, and test them there. You should not have to instantiate an application server to perform unit tests.
Sorry for the terse answer above, the iPad posts whenever I hit return while editing a post.
dUnit is designed to perform unit testing, and what you are trying to do is NOT unit testing.
A test is not a unit test if:
It talks to the database
It communicates across the network
It touches the file system
It can't run at the same time as any of your other unit tests
You have to do special things to your environment (such as editing config files) to run it.
It can't run in isolation
If you follow the SOLID principles (especially the single responsibility principle), using dUnit to test your class (without testing the Midas/DataSnap related logic) should be reasonably simple. And really, you shouldn't need to test the Midas/DataSnap logic.
But there are ways to perform integration and behavioural tests on Delphi applications.
Personally, I wouldn't use TestComplete because it doesn't integrate well with any sort of CI server and the tests are stored in a proprietary binary format (which makes merging differences or maintaining changes in any source control system problematic).
You could try dSpec, but I'm not sure Jody Dawkins is maintaining it any more.
I have used the AutoIt BASIC scripting language directly on some projects, and also used its .NET assembly to drive a Delphi application using NUnit and C# on another. While not perfect, the NUnit / C# solution was more elegant than anything I'd seen for performing functional / behavioural testing Delphi applications. It did take some effort to get it setup though.

Resources