public void NotNull_WhenValueIsNotNull_ReturnsNullGuard() { INullGuard sut = CreateSut(); INullGuard result = sut.NotNull(_fixture.Create <object>(), _fixture.Create <string>()); Assert.That(sut, Is.EqualTo(result)); }
public void NotNull_WhenValueIsNull_ThrowsArgumentNullException() { INullGuard sut = CreateSut(); string argumentName = _fixture.Create <string>(); ArgumentNullException result = Assert.Throws <ArgumentNullException>(() => sut.NotNull(null, argumentName)); Assert.That(result.ParamName, Is.EqualTo(argumentName)); }
public void NotNull_WhenArgumentNameIsWhiteSpace_ThrowsArgumentNullException() { INullGuard sut = CreateSut(); ArgumentNullException result = Assert.Throws <ArgumentNullException>(() => sut.NotNull(_fixture.Create <object>(), " ")); Assert.That(result.ParamName, Is.EqualTo("argumentName")); }