CodeVerge.Net Beta


   Explore    Item Entry   Register  Login  
Microsoft News
Asp.Net Forums
IBM Software
Borland Forums
Adobe Forums
Novell Forums

MS SQL 2008 on ASP.NET Hosting



Zone: > NEWSGROUP > Asp.Net Forum > visual_studio.visual_studio_2005 Tags:
Item Type: NewsGroup Date Entered: 4/7/2008 3:21:59 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 1 Views: 47 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
2 Items, 1 Pages 1 |< << Go >> >|
jonny75904
Asp.Net User
Unit testing core classes in web application4/7/2008 3:21:59 PM

0/0

I am having problems getting unit tests to work.  I am wanting to test a class constructor, but I'm not sure how I can determine if the constructor passed or failed.  Below is the code for the test, followed by a simple representation of the Agent class.

 

        /// <summary>
        ///A test for Agent (string, string, string, string)
        ///</summary>
        [TestMethod()]
        [HostType("ASP.NET")]
        [AspNetDevelopmentServerHost("D:\\EntComp\\1.4-dev\\Source\\custcare", "/custcare")]
        [UrlToTest("http://localhost/custcare/unittester.aspx")]
        public void ConstructorTest1()
        {
            string sAAA = "testAAA"; 
            string sDutyCode = "TestDutyCode"; 
            string sSine = "TestSine";
            string sNTNetworkID = "testNTNetworkID";
            object target = EntCompTests.AgentAccessor.CreatePrivate(sAAA, sDutyCode, sSine, sNTNetworkID);              

            //Confused as to what to put here to verify that the Agent object built correctly
        }
public class Agent
{
private string AAA;
private string DutyCode;
private string NTNetworkID;
private string AgentSine;

//Constructor
public Agent(string sAAA, string sDutyCode, string sNTNetworkID, sAgentSine)
{
AAA = sAAA;
DutyCode = sDutyCode;
NTNetworkID = sNTNetworkID;
AgentSine = sAgentSine;
}
}//End Agent class
 
Thomas Sun – MS
Asp.Net User
Re: Unit testing core classes in web application4/9/2008 9:04:35 AM

0/0

Hi,

To use Unit testing to test the constructer of a class, you can refer to this class in the TestProject, and check if the field of this class matches the value you input, or you can try to input wrong parameters to check if exception is thrown.

For more information, see http://aspalliance.com/845

 

I hope this helps.

 


Please remember to click ?Mark as Answer? on the post that helps you, and to click ?Unmark as Answer? if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
2 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
Professional PHP5 Authors: Ed Lecky-Thompson, Steven D. Nowicki, Heow Eide-Goodman, Alec Cove, Pages: 639, Published: 2004
Pro Spring: From Professional to Expert Authors: Rob Harrop, Jan Machacek, Pages: 806, Published: 2005
SDL 2005: Model Driven : 12th International SDL Forum, Grimstad, Norway, June 20-23, 2005 : Proceedings Authors: Andreas Prinz, Rick Reed, Pages: 359, Published: 2005
Peterson's Graduate Programs in Engineering & Applied Sciences: Engineer/Appld Sci 2006 Authors: Peterson's, Pages: 1536, Published: 2005
Flash Video for Professionals: Expert Techniques for Integrating Video on the Web Authors: Lisa Larson, Renee Costantini, Pages: 362, Published: 2007
Professional Software Testing with Visual Studio 2005 Team System: Tools for Software Developers and Test Engineers Authors: Tom Arnold, Dominic Hopton, Andy Leonard, Mike Frost, Pages: 372, Published: 2007
Professional Visual Studio 2005 Team System Authors: Jean-Luc David, Tony Loton, Erik Gunvaldson, Christopher Bowen, Noah Coad, Darren Jefford, Pages: 700, Published: 2006
Expert Spring MVC and Web Flow Authors: Seth Ladd, Darren Davison, Steven Devijver, Keith Donald, Colin Yates, Pages: 403, Published: 2006
Java Enterprise in a Nutshell: A Practical Guide Authors: Jim Farley, William Crawford, Prakash Malani, John G. Norman, Justin Gehtland, Pages: 871, Published: 2005
Professional Refactoring in Visual Basic Authors: Danijel Arsenovski, Pages: 517, Published: 2008

Web:
Jacob Santos · Unit Tests Work! A Look at WordPress Aug 25, 2008 ... The problem is from using serialize on classes, which when added, ... http://www .santosj.name/web-applications/unit-tests-work-a-look-at- ...
Unit Test Your Struts Application | O'Reilly Media Sep 22, 2004 ... How to insert unit-testing opportunities into Struts applications. ... When we look at a web application, we find it is still possible to ...
Live aus der Marschrutka: Functional unit testing for web ... Sep 14, 2006 ... Unit testing web applications is relatively hard, because you usually have ... Selenium comes in several flavours: one is Selenium Core, ...
Skills Matter : Ajax & RIA: Watch Joe Walker on DWR, check o Michael Mathews : 9th Jul 2008, View Podcast: Practical Unit Testing in JavaScript ,. Roberto Saccon:Erlang and Ajax Web Applications, ...
Ajax Core: Web Application Development with Ajax (SKM-2125) Ajax Core: Web Application Development with Ajax (SKM-2125) ... Testing Ajax applications. Unit testing JavaScript technology; End-to-end testing ...
Django | Testing Django applications | Django Documentation Testing a Web application is a complex task, because a Web application is made ... Unit tests -- tests that are expressed as methods on a Python class that ...
symfony | Web PHP Framework | The Askeet Tutorial | symfony advent ... The UnitTestCase class is the core class of the Simple Test unit tests. .... Web applications are not all about objects that behave more or less like ...
Test Web applications with HttpUnit - JavaWorld Starting from the simplest components, classes, the developers or specialized test developers need to program unit tests to ensure that the application's ...
Relevance Training: Rails Class size:. Up to 18. Supplied Materials:. Agile Web Development with Rails; Course CD ... types of tests; unit testing; assertions; testing exceptions ...
ASP.NET Training: Beginning ASP.NET with C# NET Framework, as well as the use of the core classes for Web user ... Creating a test plan; Executing unit tests; Testing international applications ...

Videos:
Core Patterns for Web Permissions Google TechTalks July 19, 2006 Tyler Close Visiting Scientist Hewlett-Packard Laboratories Mr. Close is a researcher and developer, working in the...




Search This Site:










firefox, tables, and master pages

ignoring elements from the master page

override masterpage

question about asp:menu class and horizonal sub menus

parser error in web with multi themes

displaying other website contents in content place holder

how do i switch images based on browser version?

sending back values to opener pages with master pages

showing an external url inside a contentplaceholder.

dynamically update web.sitemap

best way to handle banner on master page

master page with base href

how to pull titles from db and sitemap at run time?

global master page

sitemapnode title

opening external website in new windown - help

error: asp.net runtime error: theme 'idm' cannot be found in the application or global theme directories

a simple treeview question

update label in masterpage from another page

master page footer

menu in asp.net

site map

server control and master page

setting global parameter in master page

deriving from treenode and override renderpre and posttext

pages sometimes load scrambled

sitemappath and self joined table

how do i programmatically edit a theme or skin file

treeview expanddepth property causes visual studio to throw a jscript error

masterpage and menuitem navigateurl

  Privacy | Contact Us
All Times Are GMT