public void GetCommand_OptionObject2015_GetFieldValue_ReturnsGetFieldValueCommand()
        {
            // Arrange
            OptionObject2015     optionObject = new OptionObject2015();
            string               parameter    = "GetFieldValue,123";
            GetFieldValueCommand expected     = new GetFieldValueCommand(optionObject, parameter);

            // Act
            IRunScriptCommand actual = CommandFactory.GetCommand(optionObject, parameter);

            // Assert
            Assert.AreEqual(expected.GetType(), actual.GetType());
        }
예제 #2
0
        public void GetCommand_OptionObject2_GetFieldValue_ReturnsGetFieldValueCommand()
        {
            // Arrange
            OptionObject2          optionObject          = new OptionObject2();
            IParameter             parameter             = new Parameter("GetFieldValue,123");
            IOptionObjectDecorator optionObjectDecorator = new OptionObjectDecorator(optionObject);
            GetFieldValueCommand   expected = new GetFieldValueCommand(optionObjectDecorator, parameter);

            // Act
            IRunScriptCommand actual = CommandFactory.GetCommand(optionObject, parameter);

            // Assert
            Assert.AreEqual(expected.GetType(), actual.GetType());
        }
        public void RunScript_GetFieldValue_OptionObject2_ReturnsErrorCode0()
        {
            // Arrange
            FieldObject fieldObject = new FieldObject()
            {
                FieldNumber = "123",
                FieldValue  = "TESTING"
            };
            RowObject rowObject = new RowObject()
            {
                Fields = new List <FieldObject>()
                {
                    fieldObject
                },
                RowId = "1||1"
            };
            FormObject formObject = new FormObject()
            {
                CurrentRow = rowObject,
                FormId     = "1"
            };
            OptionObject2 optionObject = new OptionObject2()
            {
                Forms = new List <FormObject>()
                {
                    formObject
                }
            };

            IOptionObjectDecorator optionObjectDecorator = new OptionObjectDecorator(optionObject);
            IParameter             parameter             = new Parameter("GetFieldValue,123");
            var command = new GetFieldValueCommand(optionObjectDecorator, parameter);

            // Act
            OptionObject2 returnOptionObject = (OptionObject2)command.Execute();

            // Assert
            Assert.AreEqual(3, returnOptionObject.ErrorCode);
        }
예제 #4
0
        public void RunScript_GetFieldValue_OptionObject2015_ReturnsErrorCode0()
        {
            // Arrange
            FieldObject fieldObject = new FieldObject()
            {
                FieldNumber = "123",
                FieldValue  = "TESTING"
            };
            RowObject rowObject = new RowObject()
            {
                Fields = new List <FieldObject>()
                {
                    fieldObject
                },
                RowId = "1||1"
            };
            FormObject formObject = new FormObject()
            {
                CurrentRow = rowObject,
                FormId     = "1"
            };
            OptionObject2015 optionObject = new OptionObject2015()
            {
                Forms = new List <FormObject>()
                {
                    formObject
                }
            };
            string parameter = "GetFieldValue,123";
            var    command   = new GetFieldValueCommand(optionObject, parameter);

            // Act
            OptionObject2015 returnOptionObject = command.Execute();

            // Assert
            Assert.AreEqual(3, returnOptionObject.ErrorCode);
        }