Skip to content
Browse files

Added a unit test to cover the new ViewBag on the View

  • Loading branch information...
1 parent a62e596 commit 61b70f25132aac96256b5f8cf93f96a822c933ee @RobertTheGrey RobertTheGrey committed Feb 5, 2011
View
1 src/Spark.Web.Mvc.Tests/Spark.Web.Mvc.Tests.csproj
@@ -53,6 +53,7 @@
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
+ <Reference Include="Microsoft.CSharp" />
<Reference Include="nunit.framework, Version=2.4.3.0, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\bin\nunit\nunit.framework.dll</HintPath>
View
8 src/Spark.Web.Mvc.Tests/SparkViewTester.cs
@@ -13,6 +13,7 @@
// limitations under the License.
//
using System;
+using System.Dynamic;
using System.IO;
using System.Web;
using System.Web.Mvc;
@@ -111,5 +112,12 @@ public void CanAccessModelViaModel()
var view = new ModelViewTest { ViewData = { Model = "asd" } };
Assert.AreEqual("asd", view.Model);
}
+
+ [Test]
+ public void CanAccessViewBagViaView()
+ {
+ var view = new ModelViewTest { ViewBag = { SomeProperty = "dgf" } };
+ Assert.AreEqual("dgf", view.ViewBag.SomeProperty);
+ }
}
}

0 comments on commit 61b70f2

Please sign in to comment.
Something went wrong with that request. Please try again.