public void IsNotNull_WhenValueIsNull_WritesTraceMessage() { var listener = new TestListener(); Trace.Listeners.Add(listener); var data = new FileData { StringValue = null }; Assert.Throws<ArgumentException>(() => data.IsNotNull()); Assert.AreEqual("Test:IsNotNullFailed:IsNotNull", listener.Output); Trace.Listeners.Remove(listener); }
public void IsNotNull_WhenValueIsNull_Throws() { var data = new FileData { StringValue = null }; Assert.Throws<ArgumentException>(() => data.IsNotNull()); }
public void IsNotNull_WhenValueIsNotNull_Succeeds(string value) { var data = new FileData { StringValue = value }; Assert.DoesNotThrow(() => data.IsNotNull()); }