コード例 #1
0
        public void NotNull_WhenValueIsNotNull_ReturnsNullGuard()
        {
            INullGuard sut = CreateSut();

            INullGuard result = sut.NotNull(_fixture.Create <object>(), _fixture.Create <string>());

            Assert.That(sut, Is.EqualTo(result));
        }
コード例 #2
0
        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));
        }
コード例 #3
0
        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"));
        }