예제 #1
0
        public void ConvertTest()
        {
            var width = 12.34;
            var converter = new BoolToWidthConverter() {Width = width};

            var actual = converter.Convert(false, null, null, CultureInfo.InvariantCulture);

            Assert.AreEqual(double.NaN, actual);

            actual = converter.Convert(true, null, null, CultureInfo.InvariantCulture);

            Assert.AreEqual(width, actual);
        }
예제 #2
0
 public void WhenCalledConvertWithNotIsExpanded_ReturnsNaN()
 {
     const double width = 123.45;
     var boolToWidthConverter = new BoolToWidthConverter();
     boolToWidthConverter.Width = width;
     Assert.AreEqual(boolToWidthConverter.Convert(false, null, null, null), double.NaN);
 }
예제 #3
0
 public void WhenCalledConvertWithIsExpanded_ReturnsCorrectWidth()
 {
     const double width = 123.45;
     var boolToWidthConverter = new BoolToWidthConverter();
     boolToWidthConverter.Width = width;
     Assert.AreEqual(boolToWidthConverter.Convert(true, null, null, null), width);
 }