public void ConvertsBoolean() { var converter = new NegateValueConverter(); var value = false; Assert.Equal(true, converter.Convert(value, null, null, null)); }
public void ConvertsPoint() { var converter = new NegateValueConverter(); var value = new Point(1, 2); var negated = (Point)converter.Convert(value, null, null, null); Assert.True(negated.X == -1 && negated.Y == -2); }
public void ConvertEqualsConvertBack() { var converter = new NegateValueConverter(); int value = -123; Assert.Equal( converter.Convert(value, null, null, null), converter.ConvertBack(value, null, null, null)); }
public void ConvertsCornerRadius() { var converter = new NegateValueConverter(); var value = new CornerRadius(3); var negated = (CornerRadius)converter.Convert(value, null, null, null); Assert.True(negated.BottomLeft == negated.TopLeft && negated.BottomLeft == negated.TopRight && negated.BottomLeft == negated.BottomRight && negated.BottomLeft == -3); }
public void ConvertsThickness() { var converter = new NegateValueConverter(); var value = new Thickness(3); var negated = (Thickness)converter.Convert(value, null, null, null); Assert.True(negated.Top == negated.Bottom && negated.Top == negated.Left && negated.Top == negated.Right && negated.Top == -3); }
public void ThrowsNotSupportedExceptionForUnsupportedType() { var converter = new NegateValueConverter(); Assert.Throws<NotSupportedException>(() => converter.Convert(new NegateValueConverterTests(), null, null, null)); }
public void ConvertsIConvertible(IConvertible value, IConvertible negated) { var converter = new NegateValueConverter(); Assert.Equal(value, converter.Convert(negated, null, null, null)); }