public void AssertValidOnInvalidObjectThrowsArgumentException() { var sut = new TestModel(); var ex = Assert.Throws <ArgumentException>(() => sut.AssertValid("sut")); Assert.Equal("sut", ex.ParamName); Assert.Contains("Name: Value is required.", ex.Message); }
public void AssertValidOnInvalidObjectThrowsArgumentException() { var sut = new TestModel(); var ex = Assert.Throws<ArgumentException>(() => sut.AssertValid("sut")); Assert.Equal("sut", ex.ParamName); Assert.Contains("Name: Value is required.", ex.Message); }
public void AssertValidOnValidObjectDoesNotThrowException() { var sut = new TestModel { Name = "Name", SubModel = new SubModel { Property1 = "1" } }; sut.AssertValid("sut"); }