public void correct_string_value_for_decimal_value_is_returned()
        {
            var specifiers = new ReadOnlyDictionary <string, string>(new Dictionary <string, string>
            {
                { Specifier, "1.5" }
            });
            var operand = new SimpleOperand(specifiers, Specifier);

            Assert.AreEqual("1.5", operand.GetStringValue().Result, "Decimal value returned by the operand is not correct");
        }
        public void correct_int_value_for_int_is_returned()
        {
            var specifiers = new ReadOnlyDictionary <string, string>(new Dictionary <string, string>
            {
                { Specifier, "2" }
            });

            var operand = new SimpleOperand(specifiers, Specifier);

            Assert.AreEqual(2, operand.GetIntValue().Result, "Int value returned by the operand is not correct");
        }
        public void get_int_value_for_decimal_value_fails()
        {
            var specifiers = new ReadOnlyDictionary <string, string>(new Dictionary <string, string>
            {
                { Specifier, "1.5" }
            });
            var operand = new SimpleOperand(specifiers, Specifier);

            try
            {
                var x = operand.GetIntValue().Result;
                Assert.IsNotNull(x);
            }
            catch (AggregateException ex)
            {
                throw ex.InnerExceptions.First();
            }
        }
        public void wrong_specifier_on_get_string_value_failles()
        {
            var specifiers = new ReadOnlyDictionary <string, string>(new Dictionary <string, string>
            {
                { Specifier, "1.5" }
            });
            var operand = new SimpleOperand(specifiers, "missing");

            try
            {
                var x = operand.GetStringValue().Result;
                Assert.IsNotNull(x);
            }
            catch (AggregateException ex)
            {
                throw ex.InnerExceptions.First();
            }
        }
Beispiel #5
0
 public Destruct(ISimpleClassification <SimpleTerm> @operator, SimpleOperand operand)
     : base(Operations.Destruct)
 {
     Operator = @operator;
     Operand  = operand;
 }