Also test `string.Empty` model
This commit is contained in:
parent
6eb1e38e33
commit
bbf470bd34
|
|
@ -153,11 +153,13 @@ namespace Microsoft.AspNet.Mvc.Core.Test
|
|||
Assert.Equal("Model string", result.ToString());
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void DisplayFor_FindsModel_EvenIfNull()
|
||||
[Theory]
|
||||
[InlineData(null)]
|
||||
[InlineData("")]
|
||||
public void DisplayFor_FindsModel_EvenIfNullOrEmpty(string propertyValue)
|
||||
{
|
||||
// Arrange
|
||||
var model = new DefaultTemplatesUtilities.ObjectTemplateModel();
|
||||
var model = new DefaultTemplatesUtilities.ObjectTemplateModel { Property1 = propertyValue, };
|
||||
var viewEngine = new Mock<IViewEngine>();
|
||||
viewEngine
|
||||
.Setup(v => v.FindPartialView(It.IsAny<IDictionary<string, object>>(), It.IsAny<string>()))
|
||||
|
|
|
|||
|
|
@ -167,11 +167,13 @@ Environment.NewLine;
|
|||
result.ToString());
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void EditorFor_FindsModel_EvenIfNull()
|
||||
[Theory]
|
||||
[InlineData(null)]
|
||||
[InlineData("")]
|
||||
public void EditorFor_FindsModel_EvenIfNullOrEmpty(string propertyValue)
|
||||
{
|
||||
// Arrange
|
||||
var model = new DefaultTemplatesUtilities.ObjectTemplateModel();
|
||||
var model = new DefaultTemplatesUtilities.ObjectTemplateModel { Property1 = propertyValue, };
|
||||
var viewEngine = new Mock<IViewEngine>();
|
||||
viewEngine
|
||||
.Setup(v => v.FindPartialView(It.IsAny<IDictionary<string, object>>(), It.IsAny<string>()))
|
||||
|
|
|
|||
Loading…
Reference in New Issue