Visual Studio :: Unit Testing Suggestions For Methods That Are Normally Void?
Jun 9, 2010
have a test project for testing methods in the Business/Models tier of my application. For methods that do calculations or have return types this works great.What would some suggested ways to perform (any is this even necessary) testing on methods that would normally have no return type, such as a 'Delete' method?Example:
[Code]....
View 3 Replies
Similar Messages:
Feb 23, 2011
Recently for a class to implement unit test for one of its private methods I used PrivateObject by creating private accessor instead of refelection, to which i received a code review comment as below
"My main concern with Private Object is the use of object[] in constructor. It replaces strong typing enforced by compiler with JavaScript-style run-time error detection.Consequently , personally, I would not recommend it."
Comments above confused me beacuse as per my understanding reflection also needs the object[] to invoke any method.
View 2 Replies
Feb 16, 2010
I am new to .NET
what is Unit Testing in VS 2008 and how to implement it.
View 3 Replies
Mar 9, 2010
This is sudhir iam new in testing in vusual studio 2008 . how to do the unit testing in visual studio 2008
View 1 Replies
Aug 26, 2010
I am lookinf for a Unit testing Tool for asp.net web application. i intended to use visual studio 2008 web test. Please tell me where can i get nice tutorials to start up on this tool. and also suggest me is any other web testing tools out there.
View 1 Replies
Feb 5, 2010
My que is why use NUnit if VS2008 has built in Unit Testing
In my company app they are uing NUnit and I am wondering why. Now VS2008 has built in Unit Testing so why to use NUnit?
View 1 Replies
Mar 2, 2010
I want to create a unit testing project for my existing websiet which is written in VB. When I try to add a unit testing , no place I can select c#. It always create in VB. How can i add a c# unit testing project for it?
I am using visual studio professional 2008
View 2 Replies
Aug 4, 2010
is there any tutorial about how to run a unit testing on a web page (events...etc) in visual studio 2008? is it even possible? i can find anything to start with
View 1 Replies
Jun 12, 2010
i created a unit test project with the built-in unit testing from vs 2008. i noticed that when running a unit test and in particular when the class i am testing attempts to set a value from the app.config file using the configurationsettings, the configuration settings object always has 0 keys...and thus my value i am trying to use is always null...is there anything about the unit testing structure that would return null values from the app config when i know the keys are there...the existing program uses those keys for email addresses and such already.
View 1 Replies
Jan 18, 2011
am working as a web developer in a company. I am not aware of anything related to testing. Our company is planning to buy some testing softwares. Presently we are working on ASP.NET. We will be working on PHP and JAVA in future. I need your help to find out the best but cost effective testing sofwares.on TFS and Visual Studio Testing tool.
View 2 Replies
Mar 1, 2010
I have VS 2008 Professional Edition.....I want to test a function like this:
public int getIdByName(string name)
{
var item=from x in DATAB
where x.name=name
select x.id;
.
.
return idValue;
}
now I test end I have:
[TestMethod()]
public getIdByNameTest()
{
string name="Bob"
int expected = 1;
int actual;
actual = ClassGET.getIdByName(name);
Assert.AreEqual(expected, actual);
Assert.Inconclusive("Verify the correctness of this test method.");
}
The error in "test run" is:
Failed ......[Class]....... Test method threw exception: System.ArgumentException: The specified named connection is either not found in the configuration that is not for use with the EntityClient provider or thought is invalid
View 7 Replies
May 6, 2010
I'm using VSTS 2K8 and I've set up a Unit Test Project. In it, I have a test class with a method that does a simple assertion. I'm using an Excel 2007 spreadsheet as my data source.
My test method looks like this:
[Code]....
As indicated in the method decoration attributes, my Excel spreadsheet is on my local C:/ Drive. In it, the sheet where all of my data is located is named "Sheet1".I've copied the Excel spreadsheet into my project and I've set its Build Action = "Content" and I've set its Copy to Output Directory = "Copy if Newer".
When trying to run this simple unit test, I receive the following error:
The unit test adapter failed to connect to the data source or to read the data. For more information on troubleshooting this error, see "Troubleshooting Data-Driven Unit Tests" (http://go.microsoft.com/fwlink/?LinkId=62412) in the MSDN Library. Error details: ERROR [42S02] [Microsoft][ODBC Excel Driver] The Microsoft Office Access database engine could not find the object 'Sheet1'. Make sure the object exists and that you spell its name and the path name correctly.
I've verified that the sheet name is spelled correctly (i.e. Sheet1) and I've verified that my data sources are set correctly.Web searches haven't turned up much at all.
[Code]....
View 5 Replies
Jun 6, 2010
I'd like to tryout ASP.NET MVC2, im using VWD2010 on Windows 7. I can't seem to be able to get the unit test dialog to pop up. I googled it and all I find is nUnit templates for VWD2008.
Anyone running into this issue with same setup as mine?
View 3 Replies
Oct 19, 2010
I have a unit test that reads from an .xml file and it works fine on my local machine.However, in TFS when I create a new build it gives the following exception:
Failed GetArticleByIdTestOptimal Test method Test.ArticleSystemTest.GetArticleByIdTestOptimal threw exception: System.Xml.XmlException: ImportFromFile filePath=[.Articles1to5.xml]. ---> System.IO.FileNotFoundException: Could not find file 'c:uildareaTestResults fservice
2010-10-19 11_52_19_Any CPU_ReleaseOutArticles1to5.xml'..
Is there some reason why a unit test could pass locally but not in TFS? I've verified that the file is on the build server.
View 1 Replies
Mar 17, 2011
I recently came accross the following article on Stephen Walther's website
[URL]
Basically, it provides some excellent guidance on how to integrate your Javascript tests into Visual Studio. I followed the steps in the article and successfully managed to test Javascript methods using Visual Studio tests.
I am unable however to unit test JQuery methods (I get errors such as "window" undefined). I was wondering if anyone has successfully managed to test jQuery methods on the server using the above link?
View 2 Replies
Feb 18, 2010
I have one assembly with unit tests to my each library.
Each assembly prepares clean test data by restoring database (SQL Server):
[AssemblyInitialize()]
public static void AssemblyInit(TestContext context)
{
TestInitialize();
DatabaseCreator.CreateTestDatabase("crm");
DatabaseCreator.CreateTestDatabase("workflow");
}
How to force tests from one test library run in one 'packet' - I mean - all tests from A.dll, then all tests from B.dll and so on?
Now, when libraries use the same database, mixing tests from various libraries causes errors - one library restores database before test method is started from other library....
The other possibility, that I'm thinking about is to not use assembly load startup method, but restore all databases only once - before first test starts - but I don't know how to do it...
View 4 Replies
Jan 20, 2010
So I started a new solution in vs2010b2.
1. I added a WebService project to this solution.
2. I added a WebApplication project to this solution.
3. I clicked Add Web Reference
4. I clicked Web services on the local machine
5. Web Services listed on my local machine:
"There was an error while enumerating services on local machine:
Active Directory Services cannot find the web server. A possible cause for this is an incompatibility between versions of Internet Information Server (IIS) on the client and the server. Another possible cause is that IIS is not installed on the local machine, or the user identity under which you are running may not have permissions to view websites on this machine. To view websites on this machine, make sure that you run Visual Studio as administrator. On Windows Vista computers with IIS installed, make sure that
IIS Metabase and IIS 6 configuration compatibility feature is enabled."
I have Visual Studio 2010 beta and Visual Studio 2008 Professional installed on this computer. I do not have any IIS server installed. Do I require a IIS server when coding webservices+webapplications?[URL]
View 1 Replies
Feb 2, 2010
i am finished writing the main part of my website and would now like to write the iphone version. is there a way to debug my site using the built in debugger in visual studio? i have only been able to access it on the computer it is running on.
View 3 Replies
Nov 2, 2010
I am using ASP.NET MVC and want to have Unit Test functionality integrated within Visual Web Developer 2010 Express (or Visual Studio LightSwitch). Is it possible and if so, what is the recommended/best way to get it?
View 1 Replies
Oct 25, 2010
I have webservice running, how to test those web methods using the Test features of Visual Studio 2010.
As with normal web reference i am not able to create the classes and call the webmethods inside the test class.
View 1 Replies
Feb 25, 2011
I want to load test an ASP.NET web service. I have Visual Studio 2008 Professional Edition and Visual Studio 2010. Can either one of these products facilitate load testing? I can't seem to find anything and all Google returns is higher end editions of Visual Studio.If not, what are some of the alternatives.
View 3 Replies
Feb 4, 2010
Is there any way to test my website using MS .net 2008 tool.
View 1 Replies
Mar 22, 2010
For developing a VS-2008 application at developing stage best softwares for test the application.we found some of the testing applications like NUnit and MSUnit, which are the softwares best to test the application at developing stage.
View 2 Replies
Jan 27, 2010
I have Visual Studio 2008 Standard Edition- Version 3.5 SP1 (9.0.30729.1 SP).I've noticed when working through examples they show a window, Create Unit Test Project, but that this window never appears when I follow their steps.Do I need to go somewhere and check a box so the program will give me this window?Does this mean VS2008 didn't install correctly?
View 2 Replies
Apr 3, 2011
I have been looking at the unit testing topic and honestly I have never yet seen it in a live application.
Im a little foggy on the subject....
A simple example is if I am populating a listbox with data, I would know through debugging if the data is being populated and if it wasnt it would probably be easy to figure out why. Futhermore I couldnt possibly put it in production if it wasnt work so, why would I need to do a unit test? I dont see the point of it.
View 4 Replies