public void CheckConvertStringToBool_ReturnsTrue(string value)
        {
            // Act
            var actualValue = (bool)stringToBooleanConverter.Convert(value, null, null, null);

            // Assert
            Assert.True(actualValue);
        }
예제 #2
0
        public void NotEmptyStringConverter()
        {
            var converter = new StringToBooleanConverter();

            Assert.AreEqual(true, converter.Convert("not null", typeof(bool), null, null));
            Assert.AreEqual(false, converter.Convert(null, typeof(bool), null, null));
            Assert.AreEqual(false, converter.Convert("", typeof(bool), null, null));
            Assert.AreEqual(null, converter.ConvertBack(null, typeof(bool), null, null));
        }
        public void TestConverterShouldConvertNull()
        {
            var result = _converter.Convert(string.Empty);

            Assert.That(result, Is.Null);
        }