7
votes
0answers
556 views

How to get the HTML of ASP.NET MVC 3 page into a QUnit test?

I've started using QUnit for testing the jQuery code of a certain page in my ASP.NET MVC3 application. So far I've provided a HTML-mock which the javascript-file under test uses. Is it possible to ...
2
votes
0answers
49 views

How to ensure that JS anonymous objects continue to map onto POCO ViewModels

We have an ASP.NET MVC application that extensively uses AJAX calls. These AJAX calls send data to our controller method - this controller method requires an argument which is a simple POCO ViewModel ...
2
votes
0answers
812 views

How to unit test a controller that calls Url.Action using AutoMockContainer?

This question is very similar to 674458 but I really want to use the AutoMockContainer in my unit tests. I cannot figure out how to setup up my context. Has anyone been able to unit test a controller ...
1
vote
0answers
48 views

Test method is inconclusive: Test wasn't run. Error?

I have a test class and below I have psoted a sample test from the test class namespace AdminPortal.Tests.Controller_Test.Customer { [TestClass] public class BusinessUnitControllerTests { ...
1
vote
0answers
66 views

Using / Mocking Request.Url when using MvcContrib TestHelper

I'm using MvcContrib.TestHelper, and initialize my controller like this: var accountController = new AccountController(); var builder = new TestControllerBuilder(); ...
1
vote
0answers
99 views

Asp.net MVC empty ViewResultBase.Model

I read a book Pro ASP.NET MVC 3 Framework. I have a little problem with unit test. When i run this test, it not passed because result variable is null. // Arrange // - ...
1
vote
0answers
55 views

Expression Equality or Equivalence from Multiple Projects

It is understood that: Expression<Func<string, bool>> first = x => x.Length == 4; Expression<Func<string, bool>> second = x => x.Length == 4; ...
1
vote
0answers
163 views

Is this a bug in the MvcContrib TestHelper OutBoundUrl class?

I am trying to test the outbound URL of an action method in an MVC area using the MvcContrib TestHelper's static OutBoundUrl class. Here is what I have: OutBoundUrl.Of<ErrorsController>(action ...
0
votes
0answers
17 views

Please help me write unittest case for the register method in mvc

I created registration in mvc3 using entity framework, I 'm new to the mvc and the unit test cases, even in sample program accontcontroller did not carry any testmethods. Please guide me. public ...
0
votes
0answers
40 views

MVC 4: Testing if the controller action is calling the repository method

I'm new to this testing thing. I have a MVC 4 application, and I want to start testing it. I first want to test if the Action method in my controller are calling the methods in repository or not. I ...
0
votes
0answers
20 views

Unit Tests - Referencing 3.0.0.0 MVC, version actually 4.0.0.0

I've googled, however the answers haven't been that helpful for me personally. I am currently testing SendEmail using Unit Tests (Nunit) // Arrange var mockDbContext = new Mock<DbContext>(); ...
0
votes
0answers
23 views

Unit test RedirectToRouteResult

I have the following code in my controller: public class MyController : BaseController { public ActionResult MyMethod() { ... return RedirectToAction("Index", "Dashboard"); ...
0
votes
0answers
23 views

Issue unit testing an asp.net MVC controller that inherits from a custom base controller

So i'm using Moq and starting to write unit tests for my controller actions. All of my controllers inherit from a base CustomController class that provides a userId property set in the constructor ...
0
votes
0answers
107 views

ASP.NET Web Api - testing Post method with writing to text file

This is my Post method which gets information about phone and return offer for this phone (for now it's just basic): public ActionOffer Post(MobileInformation mobileInfo) { var ...
0
votes
0answers
20 views

How to unit test custom RouteBase in ASP.Net MVC

I am trying to add custom routing in my ASP.Net MVC application to deal with 301 redirecting my legacy URLs to the new format. I am using information in the following article ...

1 2 3 4 5 6
15 30 50 per page