Ejemplo n.º 1
0
        public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
        {
            if (values == null)
            {
                throw new ArgumentNullException(nameof(values));
            }

            return(values.Any(p => Booleany.IsFalsy(p)) ? Visibility.Visible : Visibility.Hidden);
        }
Ejemplo n.º 2
0
        public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
        {
            if (values == null)
            {
                throw new ArgumentNullException(nameof(values));
            }

            return(!values.All(p => Booleany.IsFalsy(p)));
        }
Ejemplo n.º 3
0
        public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
        {
            if (values == null)
            {
                throw new ArgumentNullException("values");
            }

            return(values.Any(p => Booleany.IsTruthy(p)) ? Visibility.Visible : Visibility.Collapsed);
        }
Ejemplo n.º 4
0
        public void IsTruthy_Check_Decimal_NonZero()
        {
            // arrange
            decimal value = 10m;

            // act
            bool result = Booleany.IsTruthy(value);

            // assert
            Assert.IsTrue(result);
        }
Ejemplo n.º 5
0
        public void IsTruthy_Check_Float_NonZero()
        {
            // arrange
            float value = 10f;

            // act
            bool result = Booleany.IsTruthy(value);

            // assert
            Assert.IsTrue(result);
        }
Ejemplo n.º 6
0
        public void IsTruthy_Check_Double_NaN()
        {
            // arrange
            double value = double.NaN;

            // act
            bool result = Booleany.IsTruthy(value);

            // assert
            Assert.IsFalse(result);
        }
Ejemplo n.º 7
0
        public void IsTruthy_Check_Object_NotNull()
        {
            // arrange
            object value = new object();

            // act
            bool result = Booleany.IsTruthy(value);

            // assert
            Assert.IsTrue(result);
        }
Ejemplo n.º 8
0
        public void IsTruthy_Check_String_NonEmpty()
        {
            // arrange
            string value = " ";

            // act
            bool result = Booleany.IsTruthy(value);

            // assert
            Assert.IsTrue(result);
        }
Ejemplo n.º 9
0
        public void IsTruthy_Check_DBNull()
        {
            // arrange
            DBNull value = DBNull.Value;

            // act
            bool result = Booleany.IsTruthy(value);

            // assert
            Assert.IsFalse(result);
        }
Ejemplo n.º 10
0
        public void IsTruthy_Check_IEnumerable_NonEmpty()
        {
            // arrange
            IEnumerable value = GetNonEmptyEnumerable();

            // act
            bool result = Booleany.IsTruthy(value);

            // assert
            Assert.IsTrue(result);
        }
Ejemplo n.º 11
0
        public void IsTruthy_Check_ICollection_NonEmpty()
        {
            // arrange
            ICollection value = new int[] { 1, 2, 3 };

            // act
            bool result = Booleany.IsTruthy(value);

            // assert
            Assert.IsTrue(result);
        }
Ejemplo n.º 12
0
        public void IsTruthy_Check_ICollection_Empty()
        {
            // arrange
            ICollection value = new int[0];

            // act
            bool result = Booleany.IsTruthy(value);

            // assert
            Assert.IsFalse(result);
        }
Ejemplo n.º 13
0
        public void IsTruthy_Check_Long_NonZero()
        {
            // arrange
            long value = 10L;

            // act
            bool result = Booleany.IsTruthy(value);

            // assert
            Assert.IsTrue(result);
        }
Ejemplo n.º 14
0
        public void IsTruthy_Check_Double_NegativeInfinity()
        {
            // arrange
            double value = double.NegativeInfinity;

            // act
            bool result = Booleany.IsTruthy(value);

            // assert
            Assert.IsTrue(result);
        }
Ejemplo n.º 15
0
        public void IsFalsy_Check_Boolean_True()
        {
            // arrange
            bool value = true;

            // act
            bool result = Booleany.IsFalsy(value);

            // assert
            Assert.IsFalse(result);
        }
Ejemplo n.º 16
0
        public void IsTruthy_Check_String_Empty()
        {
            // arrange
            string value = string.Empty;

            // act
            bool result = Booleany.IsTruthy(value);

            // assert
            Assert.IsFalse(result);
        }
Ejemplo n.º 17
0
        public void IsTruthy_Check_SByte_NonZero()
        {
            // arrange
            sbyte value = 10;

            // act
            bool result = Booleany.IsTruthy(value);

            // assert
            Assert.IsTrue(result);
        }
Ejemplo n.º 18
0
        public void IsTruthy_Check_Boolean_False()
        {
            // arrange
            bool value = false;

            // act
            bool result = Booleany.IsTruthy(value);

            // assert
            Assert.IsFalse(result);
        }
Ejemplo n.º 19
0
        public void IsTruthy_Check_Byte_Zero()
        {
            // arrange
            byte value = 0;

            // act
            bool result = Booleany.IsTruthy(value);

            // assert
            Assert.IsFalse(result);
        }
Ejemplo n.º 20
0
        public void IsTruthy_Check_UShort_Zero()
        {
            // arrange
            ushort value = 0;

            // act
            bool result = Booleany.IsTruthy(value);

            // assert
            Assert.IsFalse(result);
        }
Ejemplo n.º 21
0
        public void IsTruthy_Check_UInt_NonZero()
        {
            // arrange
            uint value = 10;

            // act
            bool result = Booleany.IsTruthy(value);

            // assert
            Assert.IsTrue(result);
        }
Ejemplo n.º 22
0
        public void IsTruthy_Check_Double_NonZero()
        {
            // arrange
            double value = 10d;

            // act
            bool result = Booleany.IsTruthy(value);

            // assert
            Assert.IsTrue(result);
        }
Ejemplo n.º 23
0
 public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
 {
     return(Booleany.IsFalsy(value) ? Visibility.Hidden : Visibility.Visible);
 }
Ejemplo n.º 24
0
 public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
 {
     return(Booleany.IsFalsy(value));
 }
Ejemplo n.º 25
0
 public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
 {
     return(Booleany.IsTruthy(value) ? Visibility.Collapsed : Visibility.Visible);
 }