public void NullStringValue() { MinLengthFormatter formatter = new MinLengthFormatter(50); var formatted = formatter.Format(null); formatted.Should().BeNull(); }
public void FormatValueNameResolveManagerEntityShouldNotThrowNotImplemented() { MinLengthFormatter formatter = new MinLengthFormatter(50); Action act = () => formatter.Format("something", "somename", null, null); act.ShouldNotThrow <NotImplementedException>(); }
public void FormatValueNameShouldNotThrowNotImplemented() { MinLengthFormatter formatter = new MinLengthFormatter(50); Action act = () => formatter.Format("something", "somename"); act.ShouldNotThrow <NotImplementedException>(); }
public void TestWithObject() { // the formatter expects the value to be string MinLengthFormatter formatter = new MinLengthFormatter(10); SomeDemoObject obj = new SomeDemoObject() { Integer = 100, String = "Some text", Type = "Demo" }; Action act = () => formatter.Format(obj, "Demo", new MockResolveManager()); act.ShouldThrowExactly <PtvArgumentException>($"Expected value is string! Value {obj.ToString()} of type Demo is not valid."); }