Write Use Case(s) & Test Driven Development For Binding A Gridview?
Mar 9, 2011
I'm still trying to understand and use Use Cases and Test Driven Development, but having a hard time crossing the line. I'm hoping someone can provide a good example of how setting a datasource and/or databinding a gridview could be accomplished using Test Driven Development.reate an aspx page and add the gridview control to it.create a method in the code behind called BindGrid(datacollection,gridview) that passes the collection and gridview to a method in a class outside my website so I can actually write the Unit test for the method, and returns a databound gridview.On the BindGrid method, I right click and select "Create Unit Test" which creates a new test project for me with an outline test for my BindGrid() method.Now I guess there are a number of test I could write, for example:testTrueDataCollectionBindstoGridView() to see if the collection datatype actually binds? I'm not sure the other test to write?This is how I currently understand I would go about TDD and Unit testing my example. It feels very clumsy and I'm hoping for some feedback as to what I'm doing wrong, and ideas for improvement.How would you go about writing a test for a collection binding to a control? For example say I wanted to bind a dictionary to a drop down list. What test should I be writing, and how would I go about writing them?
View 3 Replies
Similar Messages:
Nov 22, 2010
I'm used to developing private applications for very small amount of concurrent users (usually no more than 10) on very good servers, so I have never been pressed about stress testing my applications. That being said, this is something I want to have a better grasp on my applications.
FYI, all of my websites are based on ASP.NET 3.5 (WebForms), NHibernate (specially interested in testing it with numerous concurrent sessions) as the ORM of choice and require Active Directory authentication.
View 2 Replies
Jan 18, 2010
I am working on an Asp.net webiste.The response time(in case of a postback) of the pages in the website is ok on my local machine.But when I uploaded the same website to the internal development server and tried to access the server pages from my local machine,its taking bit long(in case of a postback) as compared to my local machine.I do not understand why the same webiste runs slowly on the dev server..
Following is the configuration of dev server.
Microsoft Windows Server 2003 R2 Enterprise Edition service pack 2
Intel(R) Xeon(R) CPU
E5450 @ 3.00GHZ
3.23 GHZ,2.00 GB of RAM
Physical Address extension
Following is the configuration of my local system
Microsoft Windows XP Professional Version 2002 service pack 2
Intel(R) Pentium(R) Dual CPU
E2180 @ 2.00 GHZ
2.00GHZ,1.99 GB of RAM.
View 1 Replies
Mar 16, 2011
I have a DropDownList which binds its SelectedValue to a field from an SqlDataSource. However, I need it to ignore the case when data binding, as if it's not in the correct case I recieve a lot of errors. Is this easily achievable?
View 1 Replies
Jul 7, 2010
This question is for ASP.NET and SQL Server developers. What are your best practices with respect to setting up your development and test environment? I'm interesting in the following issues: How many tiers do you recommend and what goes on on each tier? Just dev, test, and production or perhaps dev, test, staging, and production? Which types of applications and/or servers should run on actual physical hardware and which can get away with a VM? What are your strategies for loosely coupling users from web sites, web developers from their web/app/DB servers, and DB developers from their DB servers?
How do developers stay "DRY?" What are the pros and cons to putting web, app, and DB servers on their own machines? Does putting servers on separate machines in order to minimize contention for a machine's resources trump any NIC and network latencies that might be introduced by putting them on different machines? How do you configure your web apps to minimize contention for resources (e.g. virtual directories, separate application pools, etc.) How and how often do you refresh your databases on each tier? Do you just refresh the data or both the data and objects?
View 1 Replies
May 26, 2010
I am working to rebuild my company's dev/test/QA environment. We have 10-15 programmers that are involved in a number of projects. They currently all develop locally on their PCs and use the dev environment for testing. We currently do not have a QA environment, so deployments are frequently a pain because bugs are usually found after something has gone live. Here's what I envision:
Doing away with everyone's local admin privileges and making everyone develop on a dev server. Create a QA environment that is identical to our production systems. This will allow them to test deployments. Create a new test environment that is more locked down than the dev server so that proper testing can be done. What are your thoughts? What is the best way to set up an environment like this? We develop ASP .NET applications using MS Visual Studio 2008.
View 6 Replies
Dec 16, 2010
How do you test-drive ASP.NET WebForms development in VS08?
View 2 Replies
Jul 9, 2010
This question is for ASP.NET and SQL Server developers. What are your best practices with respect to setting up your development and test environment? I'm interesting in the following issues:
1. How many tiers do you recommend and what goes on on each tier? Just dev, test, and production or perhaps dev, test, staging, and production?
2. Which types of applications and/or servers should run on actual physical hardware and which can get away with a VM?
3. What are your strategies for loosely coupling users from web sites, web developers from their web/app/DB servers, and DB developers from their DB servers?
4. How do developers stay "DRY?"
5. What are the pros and cons to putting web, app, and DB servers on their own machines? Does putting servers on separate machines in order to minimize contention for a machine's resources trump any NIC and network latencies that might be introduced by putting them on different machines?
6. How do you configure your web apps to minimize contention for resources (e.g. virtual directories, separate application pools, etc.)
7. How and how often do you refresh your databases on each tier? Do you just refresh the data or both the data and objects?
View 1 Replies
Sep 1, 2010
I have a .Net 2 solution with some asp classic pages.I get a specified cast is not valid error when I access the page on my local. Below is the vb function where I get the Error:
Public Function Retrieve(ByVal vntSeqId As String, ByRef vntPart As String, ByRef vntPartKey As String, ByRef vntEntDate As String _
, ByRef vntStatus As String, ByRef vntOrigGblId As String, ByRef vntOrigNetId As String, ByRef vntOrigName As String, ByRef vntOrigPhone As String _ [code]...
At first, I thought the problem is with the source code and we were thinking the source code we have is different with the ones deployed on test and prod servers. But when I tried to upload it on the test server, I don't get the specified cast is not valid error.
View 1 Replies
Aug 19, 2010
how to Convert Uppercase to Lower case during Binding in datalist in Asp.Net.
we have data in uppercase in sql server database . Now we want to display data in datalist at aspx pages in lowercase.
we are using datalist where control is as
<asp:Label ID="lblAdd" runat="server"
Text='<%# Eval("c_Address", "{0:ToLower}") %>' ></asp:Label>
how to convert data into lower case while dispalying in datalist .
View 5 Replies
Dec 30, 2010
I created a simple web service in VS2010 (C# - XP Professional SP3 development computer -- running .Net 3.5/4.0) that just does the basic "Hello World" and changes Temperatues from Farenhet to Celcius functions and ran fine in VS2010. I then created a directory in C:Inetpubwwwrootwebsvcvs10a (of the same development computer). In the localhost IIS I converted this to an application directory (properties/create application). I tried to deploy my web service here using the publish wizard of VS2010 but was getting errors stating that the URL was not in the correct format, so I decided to just copy myService1.asmx, Web.Config, and the bin folder (which contains the compiled assembly) directly to C:Inetpubwwwrootwebsvcvs10a. Then from the localhost IIS I tried to browse myService1.asmx and received the following error:
Configuration Error
Description:An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
Parser Error Message: Unrecognized attribute 'targetFramework'. Note that attribute names are case-sensitive.
Source Error: [Code]....
Source File: c:inetpubwwwrootwebsvcvs10aweb.config Line: 6
Version Information: Microsoft .NET Framework Version:2.0.50727.3615; ASP.NET Version:2.0.50727.3618
--I tried changing the targetFramework to 3.5 in web.config, but that did not fix the problem. I then removed the targetFramework attribute from web.config and then got this error message:
Could not load file or assembly 'myVS2010Websvc' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.
Description:An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.BadImageFormatException: Could not load file or assembly 'myVS2010Websvc' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.
What can I / should I do to resolve this problem so that I can deploy this web service project to localhost -- don't I already have .Net 4.0 runtime on this machine? It is the same machine that is running VS2010.
View 2 Replies
Nov 11, 2010
I have a unit test method which tests a controller action method. The action method uses resource file to get a static message.
message = Resources.MyResource.MemberNotVerified;
However at this line the exception thrown is :-
"Could not load file or assembly 'App_GlobalResources' or one of its dependencies. The system cannot find the file specified.":"App_GlobalResources" System.IO.IOException {System.IO.FileNotFoundException}
I tried coping the whole resource file in my Test project, but it was unsuccessful.
View 1 Replies
Mar 25, 2010
I am developing a single web application that will dynamically change its content depending on which domain name is used to reach the site. Multiple domains will point to the same application. I wish to use the following code (or something close) to detect the domain name and perform the customizations:
[code]....
I would like to test the functionality of the above using the ASP.NET development server. I created mappings in the local HOSTS file to map [URL] to 127.0.0.1, and [URL] to 127.0.0.1. I then browse to the application with the browser using [URL] (etc).
When I try to test this code using the ASP.net development server the [URL] always says localhost. It does NOT capture the host entered in the browser, only localhost.
Is there a way to test the URL detection functionality using the development server?
View 1 Replies
Oct 26, 2010
I'm trying to build my first MVC site and also write unit test for the first time. I can't figure how to write unit test for methods that take parameters. How do I write a test method for this controller action?
[Code]....
View 2 Replies
Mar 19, 2010
How can I test an application that I am publishing to a remote provider's IIS7 hosted site, with the VS2008 development server that is built in with VS2008 on an XP Machine?
My membership/roles work perfectly up on the remote host. On ths hosted IIS7 site when I try to access a secure directory it redirects to login, and I am able to login, however when I launch (debug - F5) from VS2008, it will provide that folder/resource, no questions asked. Same build, config, etc... nothing has changed.
I am running XP, and local IIS version installed is 5.1.
My guess is what is happening is that the new format required in the web.config is configured properly for IIS7 deployment, which is why it works remotely, but when running locally through VS2008/XP it is running with an older version on IIS and does not recoginize the new tags.
View 3 Replies
Jul 6, 2010
How can I write a unit test for CRUD using in memory database with fluent nhibernate
View 2 Replies
Dec 30, 2010
I have my project set up with the virtual path "/MyVirtualPath", create the virtual directory in IIS 6 (W2003) and everything works fine. Then to work better with Google Analytics I change the virtual path "/myvirtualpath" and change all redicecciones and links to lowercase. also applies the class "lowercase route urls in aspnet mvc" and works perfectly.
The problem I had to modify the virtual directory in IIS, delete virtual path "/MyVirtualPath" and I created the new "/myvirtualpath", but in all cases I use tilde "~" or where I make a "RedirecToAction" (which should take "LowercaseRoute"), continues to maintain the virtual path "/MyVirtualPath". For example, if I see the HTML source code in the browser, see "/MyVirtualPath/Content/Site.css" instead of "/myvirtualpath/Content/Site.css. "
View 1 Replies
Nov 16, 2010
We have a couple of ASP.NET applications running here at work and our users get the test site confused with the production site. What is the best way to help the users know they are at the test site. Is there a best practice for how this can be accomplished? Maybe have a custom control or something on the screen display "TEST SITE"?
View 1 Replies
May 7, 2015
I have a textbox and a search button and I have a company name "aaa" in grid view
If I typed in textbox "aaa" and click on search button it works
but:
If I typed in textbox "Aaa" and click on search button it doesn't work
I want if i typed "aaa" or "Aaa" in both cases works as it is same word
View 1 Replies
Mar 25, 2010
I have a page with 6 large GridViews on it, and I'd like to add tooltips to the headers on each of the GridViews. Now I know how to add the tooltips, I'm planning to simply use a variation of the code at the bottom, but I'm wondering the best way to go about loading the data for the tooltips.
What I have is a table with descriptions of each of the columns, and I want to use those descriptions as the tooltips, but I need to do it in as light an implementation as possible, so hopefully I'm not going to the database too much, certianly I don't want to have to make a trip to the database for each cell, I'd like to load all of the data only once for each page load.
[Code]....
View 11 Replies
Feb 3, 2011
if we enter text without space in text box and then display it in gridview then it doesn't break in multiline and disturb all GUI. i try to set column width but it doesn't working.
View 6 Replies
May 15, 2010
i have to do some message exchange with a 3rd party (in a website).When the client posts a page, i start the message exchange. When that doesn't succeed for some reason, i report this to the client by rendering the page with a message.On the background, in a separate thread, i start a process to send abort messages to the 3rd party. I can't do this while the user is waiting for the page to come back, because it might take a few minutes.But in a test project, the test ends when the message to the 3rd party is sent, and after the new thread is started. But it seems that the new thread also ends, when the test is done.
Is that normal behaviour?I do start the thread in a new class with a reference to 2 objects from the class which tries to send the message in the first place, may that be a problem?EDIT: it keeps running when the whole process is started in IIS
View 1 Replies
Oct 20, 2010
We have a largely asp.net web form team (With some Oracle developers thrown in).
Question 1:
Is it a good idea to start using asp.net MVC which will mean redevelopment of a number of standard controls for not much benefit.
Question 2:
Is it a good idea to hire developers where there most recent skills are with asp.net MVC?
I doubt there is any benefit adopting MVC now, given the 100+ applications in this suite of products, and the maintenance/rework this will cause. Given this, is there any particular reason to hire MVC developers, as they won't be hitting the ground running, which is what I need now.
View 3 Replies
Jul 16, 2010
I am planning to develop a social networking website for student of a particular university with following facilities.
Forum, Blog, Creating profile, creating groups , Adding Friends, managing groups, dating, chatting etc.
Now if I start developing it from scratch, this will take a lot of time..
I couldnt find any CMS which can in developing social networking website.
Additionally, I would like the website to have my own custom design. Also it should have support for AJAX, SEO and integrating third party applications.
View 3 Replies
Sep 13, 2010
How do you know what is better to use for writing new programs? We are now using Access 2007 frontend with an SQL backend and we are going to VB.Net, what would be our next logical step?
View 4 Replies