public void GetResultCorrectTest()
        {
            _actionReleasesIfRecord = new ActionReleasesIfRecord(_worldAction, _fluent, _ifExpression);

            Fluent result = _actionReleasesIfRecord.GetResult(_startTime);
            Assert.IsTrue(result.Value);
        }
        public void IsFulfilledFalseExpressionTest()
        {
            _ifExpression = "a && b && c && !d";
            _actionReleasesIfRecord = new ActionReleasesIfRecord(_worldAction, _fluent, _ifExpression);

            bool result = _actionReleasesIfRecord.IsFulfilled(_state, _worldAction);
            Assert.IsFalse(result);
        }
        public void IsFulfilledWrongActionNameTest()
        {
            _ifExpression = "a && b && c && d";
            _actionReleasesIfRecord = new ActionReleasesIfRecord(_worldAction, _fluent, _ifExpression);
            _endedWorldAction = new WorldAction("_endedWorldAction", _startTime, _durationTime);

            bool result = _actionReleasesIfRecord.IsFulfilled(_state, _endedWorldAction);
            Assert.IsFalse(result);
        }
        public override WorldDescriptionRecord GetWorldDescriptionRecord()
        {
            string errorString;

            if (ParseAction(ComboBoxAction.SelectedIndex, out errorString)
                && ParseFluent(ComboBoxFluent.SelectedIndex, out errorString))
            {
                //allow empty ifExpression
                string expression;
                ParseExpression(TextBoxFormIf.Text, out expression, out errorString);

                WorldDescriptionRecord wdr = new ActionReleasesIfRecord(SelectedAction, SelectedFluent, expression);
                CleanValues();
                return wdr;
            }

            LabelValidation.Content = errorString;
            throw new TypeLoadException("Validation error");
        }