blob: ab6fddeb3e86d4750fd394f95174588e0378666c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
using NUnit.Framework;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Mvc;
using ${UserDefinedProjectName};
using ${UserDefinedProjectName}.Controllers;
namespace ${Namespace}
{
[TestFixture]
public class ${Name}
{
[Test]
public void Index ()
{
// Arrange
var controller = new HomeController ();
// Act
var result = (ViewResult) controller.Index ();
var mvcName = typeof(Controller).Assembly.GetName ();
var isMono = Type.GetType ("Mono.Runtime") != null;
var expectedVersion = mvcName.Version.Major + "." + mvcName.Version.Minor;
var expectedRuntime = isMono? "Mono" : ".NET";
// Assert
Assert.AreEqual (expectedVersion, result.ViewData ["Version"]);
Assert.AreEqual (expectedRuntime, result.ViewData ["Runtime"]);
}
}
}
|