I am working via Apress via Pro ASP.NET MVC 4 and used specifically in unit testing Trying to understand the syntax is the controller method.
A class It is almost like Is this technique necessary because something like this: Does not work for the pass This method is simply a simple insert embedded in the series. some controller :
Looking at a controller method for the public view list (Intel®) {ViewModel Model = New ViewModel {ModelObject = New Model Object {Object Property = Some; }} View Return (Model); } Unit Testing looks like this:
[test method] some (some) method () ... the name of the fake object is 'fake' SomeController target = new SomeController (Fake Object); // This is the next line, where the syntax is corrupting me int result = (ViewModel) target.List (1). Model). ModelObject.ObjectProperty; Assurance First (result, 1); }
ViewResult.Model , type of 'cast' type should be in the form of
ViewModel or something else I am sure this is a name for syntax / technique and I would like to know more about what is happening here.
integer = goal. List (1) Model Model Object Objectproperty;
model to be able to reach the properties of the object?
target.List (int) returns a type as an
object so that any model can be used. To type this your
ViewModel , it is necessary to tell the custardier in your test how the
model is equal to:
See Model Model = (see modal) target.list (1). Model; Int results = model. MODELObject.ObjectProperty;
No comments:
Post a Comment