MVC :: Feedback On The Most Optimal Toolsets For TDD, Mocking, And IOC?
May 25, 2010
I'll be starting a complete re-write of a system in the coming weeks. I'll be using ASP.NET MVC 2.I'm still trying to determine what I should be using as far as TDD, mocking, and IOC is concerned. I was thinking:
VSTEST for writing my TDD tests (or possibly nUnit) Moq as my mocking framework (for creating doubles and fakes) Moq for IOC development Not sure exactly what the ideal setup should be and I'm continuing to research what's available. I'd like some feedback from the community on the most optimal toolsets for TDD, mocking, and IOC.
View 10 Replies
Similar Messages:
Apr 6, 2010
In pages that have a viewstate that spans 10-15KB what would be an optimal value for
<pages maxPageStateFieldLength="">
in the web.config in order to reduce the risk of potential truncation leading to viewstate validation errors?
View 2 Replies
Mar 30, 2011
What is the best method to cache the following? I am creating an intranet web application template that will display the message, e.g., Good Morning, Justin Satyr! near the top of my master page header. Obviously, I will have to determine whether to show Morning, Afternoon or Evening. For clarity, my code is below:
string partOfDay;
var hours = DateTime.Now.Hour;
if (hours > 16)
{
partOfDay = "evening";
}
else if (hours > 11)
{
partOfDay = "afternoon";
}
else
{
partOfDay = "morning";
}
I do not want to re-determine this on each page load because that seems moderately redundant and because I have to poll a SQL server to retrieve the user's full name. What is the best way to cache this nformation? If I cache it for the length of the session, then if the user begins using the application at 11:00 AM and finishes at 3:00 PM, it will still say Good Morning. Is the best thing to do simply re-determine the M/A/E word each page load and cache the person's full name for the session? Or is there a better way?
View 3 Replies
Aug 12, 2010
i want to know if the only way to get information from database and transform them into objects is with a datareader or with a dataadapter and them looping throw the datarows, cause i have a lot of records in the table and i have to find the fastest way to do it. (like 10,000,000 records).
View 3 Replies
Apr 1, 2011
If that is even the right combination of controls to use.. I have a page that will display a list of files that have been processed or processing.. its not really time sensitive, but would like for the page to refresh the gridview every say every minutelonger(not determined yet)Is that the most optimal way to accomplish this, i mean if you are on the page, i dont want you to have to hit refresh to see any new records or status changes to the existing records..
View 4 Replies
Sep 1, 2010
I have a requirement where I would not know the columns and any result set information at design-time, so I'd be generating the data-display control dynamically.What is the most suitable way to display this type of information on-the-fly in a table/grid like structure on an ASP.NET page considering the following parameters (in order of importance):
Performance
Extensibility
Usability
I know I can dynamically generate a gridview/repeater/listview control but what I'd like to understand is which option (from stated ones or any other beyond these) would be an optimal solution..S. Paging and Sorting are part of desired functionalities, but can be overlooked if the solution is overwhelming. :)
View 2 Replies
Feb 1, 2011
i have this page called rateuser.aspx. User A logs in and can go to this page to rate&feedback any user. This is my code.
Protected Sub submit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles submit.Click
Dim connectionString As String = ConfigurationManager.ConnectionStrings("feedbackratingConnectionString").ConnectionString
Dim connection As SqlConnection = New SqlConnection(connectionString)
connection.Open()
Dim sql As String = "INSERT INTO feedbackuser(feedbacktitle,feedback,date) VALUES(@feedbacktitle,@feedback,@date);"
Dim command As SqlCommand = New SqlCommand(sql, connection)......
the first insert is to insert the feedback data into the feedback table. the 2nd insert is to insert rating data into the rating table. the 3rd insert is to take the feedbackuserID and the ratinguserID and insert it to the feedbackratinguser table (the "toMemberID" is taken from a dropdownlist and the "fromMemberID" is when i session the logged in user.) the "toMemberID" is controlled by dropdownlist where the value is in MemberID but data displayed is username. I am unable to insert the 3rd insert. The error line was "Dim reader3 As SqlDataReader = command.ExecuteReader()" and the error is "ExecuteReader requires an open and available Connection. The connection's current state is closed." how do i solve this error? the executereader is in a open connection already.
View 2 Replies
Mar 14, 2011
I just want to know, What parameters or attributes should be taken in connection string so as to handle high traffic enterprise applications? Like in general we use server, initial catalog, userid, passwd. Some times we add timeout , and in some scenario pool etc. But i don't know what attributes should i take in as my common practice apart from above.
View 3 Replies
Feb 1, 2011
i am having serious trouble doing this rateuser.aspx. in this page, the logged in user(user A) can give a feedback to any user (user B). Similarly, another user (user C) can give a feedback to user B. when user A goes to user B's page, he should be able to see all feedback that was given to user B. i am having problem in doing the retrieving as i get duplicate data. To my knowledge, one user can receive many feedback.. and one user can give many feedback. my friend said it could because my "toMemberID" has the same ID (user B), thus it duplicated.
my sql code is this :
[code]....
View 1 Replies
Mar 26, 2010
i had created a aspx page..Feedback and i had created the captcha coding... both i created in different folder...i wanna link the Feedback form with the captcha... -wen i want send the feedback, i have to write the captcha...after tat only can send.. how to link the form n captcha??
View 4 Replies
Mar 13, 2010
i want to implement a sort of feedback form/survey form in asp.net which is linked to a database. i want to create a asp.net application which will take questions from a database then display them on the form. once the user has finished the survey the results will be stored into the database.
View 3 Replies
Sep 24, 2010
I'm using a GridView control, using the Northwind database as a sandbox.
I have allowed editing of rows using AutoGenerateEditButton="true" and that all works fine. The book I'm using for reference the following code behind for error handling (C#):
[code]...
However, this seems to have no effect upon my label text, leading me to believe that the exception handling snippet won't work either.
View 1 Replies
Oct 14, 2010
I want to develope an Teacher's Rating/ Feedback/ Assesment (by students) application in .NET.There will be 20 different points on which a student will rate his/her teachesr as poor, fair, good, Very Good and Excellent.
View 4 Replies
Jun 21, 2010
I'm trying to unit test the logOn method of my .Net 4.0 MVC application. I'm pretty sure I need to mock a bunch of objects because I don't want to hit the actual database and I only want to simulate an HTTPcontext in a limited and specific way (if I have to do it at all). All the examples I've found online use mocking frameworks like Moq, RinoMocks or nMock. MVC is all about Test Driven Development, there must be some way to do simple tests without using third party software.
The specific problem,The basic problem is that the controller I'm testing calls Response.Cookies.Add(...) but since the unit test is not in an HTTPContext, Response is null and I get an exception.
My research so far,I understand there is a layer of abstraction which will help me somehow. For example HttpResponse inherits from HttpResponseBase. I think I'm supposed to make a class that inherits from one of the MVC base classes, overload some of the members and then
call the method I want to test in a way that gives it my object instead of one it would normally use.
The question is how to do that. One would need to set up existing code with the ability to construct future versions of objects. Intuitively however, it would seem that existing code could only be and use functionality that existed at the time it was written.
Fortunately, a dynamic runtime means that the code which is actually run can be determined things that change after it is written like config files and HTTP headers.
One way to do that is for the existing code to use some method typically referred to as a factory that takes a string and returns an instance of an object.I conclude that I should look through the code for this factory and figure out how to manipulate it.
My background,I've recently graduated with a degree in Computer Science. Now at my new job, I've been assigned to write unit tests for a large project. Admittedly, I'm new to MVC, many aspects of C# and large projects in general. I may have made simple mistakes or incorrect assumptions in my analysis of this problem. I will do my best to stay active on this post and make it useful for others in situations similar to mine.
View 2 Replies
Apr 20, 2010
i need to generate feedback form in html (aspx) with the aspx.cs code?
View 2 Replies
Mar 18, 2010
How could I user some feedback, using AJAX or progress bar, of the loading of web parts on the initial page load ?
View 6 Replies
Feb 26, 2013
I want a gridview for feedbcak process by students about their teachers. I need to render teachers image in header row (that,s also dynamically based on previously selected teachers), and dynamically selected questions for feedback in the header column. In the remaining cells I need star rating control to rate the teachers on respective question.
I also wanted the functionality so that teachers images i.e. header row remain in it's position while scrolling but I got the same from your previous post.I also want some hints on how to store the rated values in database.
View 1 Replies
Feb 26, 2010
I am looking for some guidance
\
-Rhino.Mocks
-Moq
-NMock
-TypeMock (not free)
View 1 Replies
Jun 1, 2010
I have a cookie which my controller uses.
How should i mock the cookie?
View 3 Replies
Apr 6, 2010
I am new to testing.I have to test some C# classes.Kindly let me know what is mocking and why some mocking framework like Rhino mock is preferred over nUint?
View 1 Replies
Jun 12, 2010
I need to create Unit Tests for an ASP.NET MVC 2.0 web site. The site uses Windows Authentication.I've been reading up on the necessity to mock the HTTP context for code that deals with the HttpContext. I feel like I'm starting to get a handle on the DI pattern as well. (Give the class an attribute of type IRepository and then pass in a Repository object when you instantiate the controller.)
What I don't understand, however, is the proper way to Mock the Windows Principal object available through User.Identity. Is this part of the HttpContext? have a link to an article that demonstrates this (or a recommendation for a book)?
View 2 Replies
Aug 25, 2010
I'm looking for as comprehensive as possible of a mock replacement and wrapper for the ASP.NET HttpContext in my applications. A comprehensive mock replacement could potentially increase the testability of my ASP.NET web applications substantially, without necessitating migrating every application to more-testable frameworks such as MVC.
Some of the features I am most interested in seeing in an HttpContext wrapper and mock framework include:
Serialized session storage (e.g., .Session).
Serialized application-scoped storage (e.g., .Application).
Per-request item storage (e.g., .Items).
HttpRequest data, such as referrers, request Uri, server variables, post data, etc.
HttpResponse data, such as status codes and content.
Local file resolution (e.g. Server.MapPath)
VirtualPathUtility for application-relative URL path resolution, which has a dependency on the ASP.NET runtime.The identity and principal (e.g., .User) for validating authentication/authorization rules.The AllErrors collection for testing error resolution in HttpModules and Global.asax.I considered writing my own interface, wrapper, and mock; however, I believe such must already exist. The variety of mock frameworks is a little overwhelming for a first-timer to absorb.
What is the most comprehensive HttpContext wrapper and mock?
View 2 Replies
Mar 28, 2011
I've see n a lot of discussions surrounding HttpSessionState and asp.net MVC.I'm trying to write tests for an asp.net application and to mock the HttpSessionState and if so, how?I'm currently using Rhino Mocks and Nunit
View 1 Replies
May 24, 2010
Microsoft Ajax can expose webservices which respond with json or xml depending on configuration. I would like to mock these services using soap ui. Using the wsdl I can do this to mock the services in the case where xml is returned, however how can I mock the response when JSON is returned?
View 1 Replies
May 17, 2010
I have a class which I store in session. Lets say Class A, having an attribute theList. I have a member function that adds an item to theList and returns the count of my list.So I mock my class and set theList to "1,2,3" for my unit test, and test my add function by adding "4".
It returns count "3" instead of "4".
View 3 Replies