Exemplo n.º 1
0
        public void NotNullOrEmpty_WhenValueIsNotNullOrEmpty_ReturnsNullGuard()
        {
            INullGuard sut = CreateSut();

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

            Assert.That(sut, Is.EqualTo(result));
        }
Exemplo n.º 2
0
        public void NotNullOrEmpty_WhenValueIsEmpty_ThrowsArgumentNullException()
        {
            INullGuard sut = CreateSut();

            string argumentName          = _fixture.Create <string>();
            ArgumentNullException result = Assert.Throws <ArgumentNullException>(() => sut.NotNullOrEmpty(string.Empty, argumentName));

            Assert.That(result.ParamName, Is.EqualTo(argumentName));
        }
Exemplo n.º 3
0
        public void NotNullOrEmpty_WhenArgumentNameIsWhiteSpace_ThrowsArgumentNullException()
        {
            INullGuard sut = CreateSut();

            ArgumentNullException result = Assert.Throws <ArgumentNullException>(() => sut.NotNullOrEmpty(_fixture.Create <string>(), " "));

            Assert.That(result.ParamName, Is.EqualTo("argumentName"));
        }