Exemplo n.º 1
0
        public void StringIsHandledCorrectly()
        {
            // Arrange
            var conv = new EmptyString();

            // Act
            var empty    = (bool)conv.Convert(string.Empty, null, null, null);
            var nonEmpty = (bool)conv.Convert(" ", null, null, null);

            // Assert
            Assert.IsTrue(empty);
            Assert.IsFalse(nonEmpty);
        }
Exemplo n.º 2
0
        public void NonStringIsHandledCorrectly()
        {
            // Arrange
            var conv = new EmptyString();

            // Act
            var nullObj = conv.Convert(null, null, null, null);
            var integer = conv.Convert(123, null, null, null);

            // Assert
            Assert.IsTrue((bool)nullObj);
            Assert.IsTrue((bool)integer);
        }