public void EnumValueInfoDropdownFor_Nullable_WithParentSampleValue() { var model = new SampleModel(); model.SomeNullableOption = TestEnum.Foo; var parent = new ParentSampleModel(); parent.Child = model; var helper = MvcHelper.GetHtmlHelper(new ViewDataDictionary <ParentSampleModel>(parent)); var html = helper.DropDownListEnumExtendedInfoFor(x => x.Child.SomeNullableOption); Assert.AreEqual(@"<select name='Child.SomeNullableOption'><option value=""""></option><option value=""0"">Boos</option><option value=""1"" selected='selected'>Foo</option></select>", html.ToHtmlString()); Console.Out.WriteLine(html.ToHtmlString()); }
public void EnumValueInfoDropdownFor_Nullable_WithParentSampleValue() { var model = new SampleModel(); model.SomeNullableOption = TestEnum.Foo; var parent = new ParentSampleModel(); parent.Child = model; var helper = MvcHelper.GetHtmlHelper(new ViewDataDictionary<ParentSampleModel>(parent)); var html = helper.DropDownListEnumExtendedInfoFor(x => x.Child.SomeNullableOption); Assert.AreEqual(@"<select name='Child.SomeNullableOption'><option value=""""></option><option value=""0"">Boos</option><option value=""1"" selected='selected'>Foo</option></select>", html.ToHtmlString()); Console.Out.WriteLine(html.ToHtmlString()); }