3

I'm following apress mvc4 receipts book and I'm struggle with following example

// act ViewResult result = controller.Index() as ViewResult; // assert Assert.IsInstanceOfType(result.Model,typeof(List<Architect>)) 

this line

Assert.IsInstanceOfType(result.Model,typeof(List<Architect>)) 

throws two errors

  1. Argument1: cannot convert from object to System.Type
  2. The best overloaded method match for Nunit.Framework.Assert.IsInstanceOfType(System.Type, object) has some invalid arguments

1 Answer 1

3

you need to swap your arguments

Assert.IsInstanceOfType(typeof(List<Architect>),result.Model); 

The best overloaded method match for Nunit.Framework.Assert.IsInstanceOfType(System.Type, object) has some invalid arguments

It says that first argument is System.Type, second object

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.