Test-Drive ASP.NET MVC by Jonathan McCracken

Posted by

By Jonathan McCracken

It really is testable. it is lightweight. it really is open-source. it really is . . . Microsoft? convinced, ultimately, Microsoft has figured it out. ASP.NET MVC 2.0 permits you to try force your code, keep an eye on the output of your HTML, and leverage C# and .NET in an easy-to-use net framework. This ebook indicates you all you want to know to start constructing net functions utilizing test-driven improvement (TDD). you are going to find out how to do every thing from developing your first attempt, to construction REST net providers, to deploying your comprehensive ASP.NET MVC functions. Test-Drive ASP.NET MVC will get you began with the entire basics you wish, no matter if you are transitioning from older Microsoft applied sciences, or in case you are coming from an open-source history and are keen on what ASP.NET MVC has to supply. ASP.NET MVC 2.0 is C# on the internet performed correct. not more fiddling round with Viewstate, IsPostBack(), and drag-and-drop coding. Microsoft has addressed the shortcomings of ASP.NET and created a framework that is going toe-to-toe with different well known internet frameworks reminiscent of Ruby on Rails. Programming in C# is enjoyable back! This booklet takes a test-first method of the most good points of ASP.NET MVC. you will get hands-on adventure construction and deploying a time-management net program from begin to end. From development your first web page, to info entry, to integrating with internet companies corresponding to Blogger.com, Test-Drive ASP.NET MVC courses you step-by-step. you will come away with an entire realizing of net providers and information entry, and you can find out how to try each one part in order that your code is bug-free and maintainable from the beginning. you will see how one can deal with defense, logging, and blunder dealing with. software program isn't really worthy until eventually it truly is deployed into construction. we are going to disguise computerized deployment utilizing MSBuild, a construct device product which could assist you get your website on-line, repeatably and reliably. all through, you are going to paintings with open resource tasks that supplement ASP.NET MVC, together with NHibernate, MVCContrib, and chateau Windsor box. those instruments accelerate constructing database parts, structure layers, and checking out your code. As you construct and installation your program, you are going to not just examine the framework itself, but in addition achieve precious adventure with the test-first technique, using your software improvement via small and measurable incremental advancements.

Show description

Read Online or Download Test-Drive ASP.NET MVC PDF

Best .net books

Microsoft Visual Studio 2010: A Beginner's Guide (A Beginners Guide)

<p align="left">Essential visible Studio 2010 Skills--Made Easy!
<p align="left">Endorsed by way of Microsoft and written by way of a Microsoft MVP and visible Studio professional, this hands-on consultant teaches programmers and builders new to visible Studio 2010 find out how to maximize the newest unlock of Microsoft's flagship improvement surroundings. Microsoft visible Studio 2010: A Beginner's advisor indicates you the way to construct purposes from the floor up. You'll additionally methods to customise the built-in improvement setting (IDE) itself, including your individual instruments that combine with visible Studio 2010.

.NET 4.0 Generics Beginner's Guide

Improve the sort protection of your code and simply create purposes utilizing . internet Generics four. zero
* find out how to use Generics' equipment and accepted collections to unravel advanced problems.
* boost real-world purposes utilizing Generics
* comprehend the significance of every commonly used assortment and commonplace type and use them as according to your requisites
* Benchmark the functionality of all general collections

In aspect

Generics have been further as a part of . web Framework 2. zero in November 2005. even though just like generics in Java, . web generics don't practice style erasure yet each item has precise illustration at run-time. there isn't any functionality hit from runtime casts and boxing conversions, that are quite often pricey. .NET deals type-safe models of each classical info constitution and a few hybrid ones.

This e-book will exhibit you every thing you must commence writing type-safe purposes utilizing general information constructions on hand in Generics API. additionally, you will see how one can use a number of collections for every activity you practice. This booklet is stuffed with functional examples, fascinating purposes, and comparisons among Generics and extra conventional ways. eventually, each one box is bench marked at the foundation of functionality for a given activity, so that you be aware of which one to take advantage of and when.

This publication first covers the elemental recommendations similar to variety defense, usual tools, and regularly occurring bins. because the ebook progresses, you'll the way to subscribe to numerous time-honored packing containers to accomplish your objectives and question them successfully utilizing Linq. There are brief routines in each bankruptcy to spice up your knowledge.

The e-book additionally teaches you a few most sensible practices, and several other styles which are quite often on hand in established code.

Some vital commonplace set of rules definitions are found in strength assortment (an API created by way of Wintellect Inc. ) which are lacking from . web framework. This publication indicates you ways to take advantage of such algorithms seamlessly with different primary containers.

The publication additionally discusses C5 collections. Java Programmers will locate themselves at domestic with this API. this is often the nearest to JCF. a few very attention-grabbing difficulties are solved utilizing wide-spread bins from . internet framework, C5, and PowerCollection Algorithms - a similar to Google Set and Gender Genie for example!

What you are going to study from this e-book
* How other kinds of regularly occurring listsare comparable
* the way to enforce your individual well-known checklist
* question all kinds of usual box alike with Linq commonplace question Operators
* increase . internet collections with common function algorithms to be had in C5 and PowerCollection
* construct concurrent apps in respiring effortless steps.
* locate these algorithms you've been lacking in . internet framework in PowerCollection and C5 API.
* learn the way various primary collections/containers practice less than benchmarking, and whilst to exploit one over one other
* Port your STL code blocks to . internet Generics which are very convenient while you're a veteran C++ developer and seeking out another in . internet world.

Approach

This is a concise, useful consultant that can assist you examine Generics in . internet, with plenty of genuine global and fun-to-build examples and transparent motives. it truly is choked with screenshots to help your knowing of the process.

Who this ebook is written for

This e-book is geared toward novices in Generics. It assumes a few operating wisdom of C# , however it isn't mandatory.

The following might get the main use out of the book:
* beginner C# builders suffering from Generics.
* skilled C++ and Java Programmers who're migrating to C# and seeking out a substitute for different frequent frameworks like STL and JCF could locate this ebook handy.
* Managers who need to know what Generics is and the way to place it to sturdy use.
* Architects will locate the benchmarking tremendous invaluable, simply because it's the 1st of its sort throughout a framework of numerous collections.

NHibernate 2.x Beginner's Guide

Speedily retrieve info out of your database into . internet gadgets contain powerful, effective information entry into your . web initiatives achieve database independence, no longer tied to any specific know-how steer clear of spending numerous hours constructing info entry layers cast off writing kept tactics transparent, certain step by step instructions to wake up and operating speedy intimately NHibernate is an open resource object-relational mapper, or just positioned, how to retrieve information out of your database into ordinary .

Professional ASP.NET Design Patterns

This special booklet takes solid ASP. web software building one step additional by means of emphasizing loosely coupled and hugely cohesive ASP. web net program architectural layout. every one bankruptcy addresses a layer in an company ASP. web software and exhibits how confirmed styles, ideas, and top practices might be leveraged to resolve difficulties and enhance the layout of your code.

Extra info for Test-Drive ASP.NET MVC

Example text

Notice that the return value on the controller methods is an ActionResult object. Views use these objects for rendering purposes, but most important, they contain the model that we will attach to get this test to pass. 1, Directing to Different Content Types with ActionResults, on page 96. To complete our assert statement, we’ll need to compare apples to apples, or in this case to lists of Todo items. To achieve this, we need to cast ActionResult as a ViewResult object. The ViewResult class is a subtype of ActionResult that has a property called ViewData; this property is the key to passing the model between the controller and the view.

ViewData is a collection of objects. It has a special property called Model, which is where the model is set and accessed in the controller. Model to be our Todo list. Unit project. 6: Adding the model to the controller makes our test pass. Our code is compiling, and it’s time to run the test and see whether it fails. 5, on the preceding page). 2, on page 34). To reach step 3—“Get the test to pass”—we’ll need to implement the Index( ) action to meet our assertion. Currently our Index( ) action simply returns a ViewResult and therefore will fail.

Once installed, we’ll be able to create the solution GetOrganized with the MVC project name Web. Although the project name Web is generic, you’ll want to keep the project names simple to save screen real estate in the Visual Studio Solution Explorer. However, you’ll want to modify the project properties to add a custom namespace by right-clicking the project properties. Web. 2, on the following page). By default Visual Studio generates an AccountController and HomeController. You can remove and replace these with your own code, but they give us a starting point for most web applications.

Download PDF sample

Rated 4.18 of 5 – based on 32 votes